angulardart / angular_components

The official Material Design components for AngularDart. Used at Google in production apps.
https://pub.dev/packages/angular_components
372 stars 123 forks source link

material-dropdown-select not showing error message when form model validation fails #452

Open Antoniossss opened 4 years ago

Antoniossss commented 4 years ago

For example if I have following markup

testModel = FormBuilder.controlGroup({
  "test1": ["", Validators.required]
});

setting empty field in model makes material-input field to show default error message "enter value" while dropdown will not show any kind of errors.

enyo commented 3 years ago

Can confirm. A simple setup also shows it:

<material-dropdown-select
  [options]="statusOptions"
  [(ngModel)]="statusValue"
  [required]="true"
  deselectLabel="Deselect"
  #status="ngForm"
  ngControl="status"
></material-dropdown-select>

<div>{{status.valid}} {{status.errors}}</div>

This shows that the status.valid is false and that there is a required validation error, but the select doesn't show anything.