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 working with Angular form #425

Closed e-belair closed 5 years ago

e-belair commented 5 years ago

I'm using StringSelectionOptions on a controlGroup form. Then when I try to select a value, the value is set in the component but the showed value remains the old one on screen.

The problem also occurs on the AngularDart Gallery (try the Single Selection w/ Angular Forms).

In component: final genreOptions = StringSelectionOptions(Genre.genres);

class Genre {
  @JsonKey(name: 'genre_id')
  int id;
  @JsonKey(name: 'genre_lib', nullable: false)
  String libelle;
  @override
  String toString() => libelle;
  Genre(this.id, this.libelle);
  static List<Genre> get genres => [Genre(1, 'Monsieur'), Genre(2, 'Madame')];
}

In the template:

<material-dropdown-select
        #genre
        id="genre"
        buttonText="{{model.interlocuteur.genre}}"
        [(ngModel)]="model.interlocuteur.genre"
        ngControl="genre"
        [options]="genreOptions"
        class="dropdown-align-with-text">
</material-dropdown-select>
e-belair commented 5 years ago

I think it's a chrome extension that break the behavior: https://chrome.google.com/webstore/detail/transover/aggiiclaiamajehmlfpkjmlbadmkledi

TedSander commented 5 years ago

Chrome extensions are not guaranteed to work well with all web technologies. They inject scripts, and can change the DOM. We don't guarantee that this widget library will work with every chrome extension.