mat-input

Angular Material DatePicker's input shifts month and day after typing

点点圈 提交于 2021-01-21 06:08:21
问题 I'm developing a app using Ionic 4/Angular 7 and Angular Material 7.2.1. The app uses brazilian date format DD/MM/YYYY. When I select the date with the datepicker itself the text in the input is fine. But, after type the date in the datepicker's (on blur) input, the month and day are switched. For example, if I type 03/02/2015, after a blur event, the input will show 02/03/2015. app.module.ts: import 'moment/locale/pt-br'; import { MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material';

Angular Material DatePicker's input shifts month and day after typing

老子叫甜甜 提交于 2021-01-21 06:05:49
问题 I'm developing a app using Ionic 4/Angular 7 and Angular Material 7.2.1. The app uses brazilian date format DD/MM/YYYY. When I select the date with the datepicker itself the text in the input is fine. But, after type the date in the datepicker's (on blur) input, the month and day are switched. For example, if I type 03/02/2015, after a blur event, the input will show 02/03/2015. app.module.ts: import 'moment/locale/pt-br'; import { MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material';

Set default directive for all input in app

倖福魔咒の 提交于 2019-12-23 17:15:54
问题 I use mat-form-field with custom css in order to change the be look like appearance="outline" directive. In Angular Material v 7.2.1 appearance="outline" was added to the mat-form-field options. How can I declare appearance="outline" as a default for each input fields in my app? 回答1: you can try to inject mat-form-field default options in your @NgModule : ... providers: [ { provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: 'outline' } } ], ... There was an issue with this https

How to change height in mat-form-field

你。 提交于 2019-12-20 17:59:09
问题 How can I change height in mat-form-field with appearance="outline" ? I need to reduce the mat-form-field. My input example 回答1: Add these to your CSS in the your original stackblitz ::ng-deep .mat-form-field-flex > .mat-form-field-infix { padding: 0.4em 0px !important;} ::ng-deep .mat-form-field-appearance-outline .mat-form-field-label { margin-top:-15px; } ::ng-deep label.ng-star-inserted { transform: translateY(-0.59375em) scale(.75) !important; } UPDATED : with transition for the label...