We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On Safari (macOS), angular2-text-mask not change input with Angular Material Datepicker. On Chrome, Firefox, Opera works correctly.
On Safari input called onBlur() function, but not toDate() function.
onBlur()
toDate()
HTML file:
<mat-form-field appearance="outline"> <mat-label>Date from</mat-label> <input type="hidden" [matDatepicker]="dateFromPicker" [min]="minDate" [max]="maxDate" formControlName="dateFrom" placeholder="Date from" /> <input matInput type="text" [textMask]="DATEPICKER_MASK" [ngModel]="form.get('dateFrom')?.value | date : form.get('dateFrom')?.value !== '' ? 'dd-MM-yyyy' : ''" [ngModelOptions]="{standalone: true}" (blur)="onBlur('dateFrom')" (change)="toDate('dateFrom', $event.target.value);" /> <mat-datepicker-toggle matSuffix [for]="dateFromPicker"> <ic-icon [icon]="calendarMonth" inline="true" size="18px" matDatepickerToggleIcon></ic-icon> </mat-datepicker-toggle> <mat-datepicker #dateFromPicker></mat-datepicker> </mat-form-field>
TypeScript file:
DATEPICKER_MASK = { guide: true, showMask: true, mask: [/\d/, /\d/, '-', /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/], };
Angular: 12.1.5 angular2-text-mask: 9.0.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
On Safari (macOS), angular2-text-mask not change input with Angular Material Datepicker.
On Chrome, Firefox, Opera works correctly.
On Safari input called
onBlur()
function, but nottoDate()
function.HTML file:
TypeScript file:
Angular: 12.1.5
angular2-text-mask: 9.0.0
The text was updated successfully, but these errors were encountered: