Using mat-form-field with the outline appearance seems to be causing some issues

When I change the body direction to RTL, the mat-form-field with appearance"outline" seems to have some issues.

If you go to the https://material.angular.io site and navigate to the Form field examples, under the Form field appearance variants section, you can edit the stack and change the body direction to RTL.

You will notice that it does not work properly.

UPDATE:

The issue was caused by Angular Material and has been fixed now.

Answer №1

I encountered a similar issue with the Dari (Persian) language, which is also right-to-left (RTL). The solution I discovered was to adjust the versions of material and angular related packages in package.json by specifying an exact match without using the ^ or ~ prefixes.

This is how my package.json file looks after the changes:

"dependencies": {
    "@angular-devkit/core": "8.0.6",
    "@angular/animations": "8.0.3",
    "@angular/cdk": "8.1.1",
    "@angular/common": "8.2.14",
    "@angular/compiler": "8.2.14",
    "@angular/core": "8.2.14",
    "@angular/flex-layout": "8.0.0-beta.26",
    "@angular/forms": "8.2.14",
    "@angular/http": "7.2.7",
    "@angular/material": "8.0.1",
    "@angular/material-moment-adapter": "5.0.0-rc.1",
    "@angular/platform-browser": "8.2.14",
    "@angular/platform-browser-dynamic": "8.2.14",
    "@angular/router": "8.2.14"
}

After making these edits to package.json, it's important to delete the package-lock.json and node_modules folders before running npm i again.

Answer №2

main.module

import { DirectionalityModule } from '@angular/cdk/bidi';

imports: [...
        DirectionalityModule
    ...]

custom.component

<mat-form-field dir="rtl" appearance="outline">...</mat-form-field>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The program is throwing an error stating that the property 'user' is not found on the data type 'DefaultRootState'

Issue Encounter I am currently encountering the error message 'user' does not exist on type 'DefaultRootState'. I have attempted to resolve it without success so far. Here is the link to my GitHub repository. Error Details C:/Users/t ...

How can I pass properties from a childComponent to a parent component in Angular 2 without prior knowledge of the childComponent's class?

My main goal is to accomplish the following : I currently have a component setup like this: import { Component, Output, EventEmitter, OnInit } from '@angular/core'; @Component({ selector: 'like', template: '<p>this is ...

Angular 8: Issue with setErrors not reflecting on the template when marking a control as invalid

In my component, I am using the following code: this.frmGroup.controls['dorms'].setErrors({'incorrect': true}); For debugging purposes, I have added the following to my template: {{this.frmGroup.controls['dorms'].invali ...

Unexpected token in catch clause in React Native TypeScript

Despite having a fully configured React Native Typescript project that is functioning as expected, I have encountered a peculiar issue: Within all of my catch blocks, due to the strict mode being enabled, typescript errors are appearing like this one: htt ...

Angular application hosted on S3, utilizing Route53 for DNS routing and personalized customization based on query strings

I have a web application built with Angular that is currently hosted on AWS S3. The visual appearance of my application varies depending on the client query string. www.example.com?client=test1 www.example.com?client=test2 My goal now is to set up a new ...

Error: Bootstrap CSS missing from app created with create-react-app-ts

I have a React application that was initially set up using create-react-app-ts. Although I have included bootstrap and react-bootstrap for navigation, the CSS styling from Bootstrap does not seem to be applied properly. The links do not display any styling ...

Encountered an error while attempting to install the DataTables npm package in an Angular

I am trying to add datatables to my angular application. Upon running ng add angular-datatables An error code is displayed (refer to the image). error image The cause of this error is unknown to me. Please review the package.json file as well. package.j ...

The one-tap login popup from Google always appears, even when the user is already logged in

Blocking Google's One Tap Login Popup in Angular 16 Is there a way to prevent Google's one tap login popup from appearing when the user is already logged in? Every time I refresh the page or save changes in the code (auto reload), the login popu ...

Furnish an item for a particular service

I am currently attempting to utilize a service created by another individual (github). This particular service requires a configuration to be passed to it. As stated in the repository: To configure Neo4jSettings in your bootstrap: provide('Neo4jSet ...

Creating a Thrilling Triple Image Transformation on Hover using Material-UI

Here is a Codepen showcasing a triple hover effect on an image: Codepen I attempted to recreate this effect as a styled component in React Typescript using MUI and MUI Image, but encountered an error with my styling that is preventing it from working in m ...

I'm experiencing an issue with my Next.js Airbnb-inspired platform where I am unable to save a listing to my favorites

While working on my Next.js Airbnb clone project, I encountered an issue with adding a Listing to favorites. The heart button component's color does not change when clicked, despite receiving a success response. Moreover, the addition to favorites is ...

Expanding a given type using Typescript

My goal is to construct a custom table using Angular, where I aim to define a TableItem type that enforces the presence of a label property for every item added to the table. For instance, consider this example: <app-my-table [items]="items&qu ...

I'm curious if it's possible to superimpose a png image and specific coordinates onto a map by utilizing react-map

I am attempting to showcase a png graphic on a react-map-gl map, following the approach outlined here. Unfortunately, the image is not appearing as expected and no error messages are being generated for me to troubleshoot. Below is the snippet of code I&a ...

Change the background color of a span element dynamically

I am currently working on implementing dynamic background coloring for a span tag in my Angular view that displays document types. The code snippet provided is as follows: <mat-card *ngFor="let record of records"> <span class="doc ...

Can you tell me about the interface type format used in the angular cli?

I found myself feeling disoriented while reading the documentation. ng generate interface <name> <type> There was ambiguity on what to input for the type field. Is it supposed to be a string, object, array, or can I define properties like ema ...

Incorporate TypeScript with Angular 2 to construct a dictionary with <key, value> pairs. Then, utilize a JSON file to populate the dictionary with data

I am in need of assistance with creating a dictionary or list with a specific structure. I have prepared a json file within my angular 2 project, and I would like to load this data into the dictionary that I am creating. Sample content from my Json file: ...

Tips for displaying dynamic images using the combination of the base URL and file name in an *ngFor loop

I have a base URL which is http://www.example.com, and the file names are coming from an API stored in the dataSource array as shown below: [ { "bid": "2", "bnam": "ChickenChilli", "adds": "nsnnsnw, nnsnsnsn", "pdap": " ...

Encountering an issue with a specific property not being defined in a spec

I am currently developing an Angular8 project and have set up jest and jasmine for testing purposes. .ts // all necessary imports are included @Component({ selector: 'app-xyz', templateUrl: './xyz.component.html', styleUrls: [& ...

Angular: The Ultimate Guide to Reloading a Specific Section of HTML (Form/Div/Table)

On my create operation page, I have a form with two fields. When I reload the page using window.reload in code, I can see updates in the form. However, I want to trigger a refresh on the form by clicking a button. I need help writing a function that can r ...

What is the best way to revert a screen's state back to its original state while utilizing react navigation?

How can I reset the state in a functional component back to its initial state when navigating using navigation.navigate()? For example, if a user navigates to screen A, sets some state, then clicks a button and navigates to screen B, and then goes back to ...