This repository was archived by the owner on Nov 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
projects/angular-material-formio/src/lib/components/select Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 11import { Component , OnInit } from '@angular/core' ;
22import { MaterialComponent } from '../MaterialComponent' ;
33import SelectComponent from 'formiojs/components/select/Select.js' ;
4+ import _ from 'lodash' ;
45@Component ( {
56 selector : 'mat-formio-select' ,
67 template : `
@@ -20,6 +21,7 @@ import SelectComponent from 'formiojs/components/select/Select.js';
2021 [formControl]="control"
2122 [placeholder]="instance.component.placeholder"
2223 (selectionChange)="onChange()"
24+ [compareWith]="compareObjects"
2325 >
2426 <div class="mat-option">
2527 <input class="mat-input-element" placeholder="Type to search" (input)="onFilter($event.target.value)">
@@ -44,7 +46,7 @@ export class MaterialSelectComponent extends MaterialComponent implements OnInit
4446 selectOptions : Promise < any [ ] > ;
4547 filteredOptions : Promise < any [ ] > ;
4648 filteredOptionsLength : number ;
47-
49+
4850 selectOptionsResolve : any ;
4951
5052 setInstance ( instance : any ) {
@@ -70,6 +72,10 @@ export class MaterialSelectComponent extends MaterialComponent implements OnInit
7072 return filtered ;
7173 } )
7274 }
75+
76+ compareObjects ( o1 : any , o2 : any ) : boolean {
77+ return _ . isEqual ( o1 , o2 ) ;
78+ }
7379}
7480SelectComponent . MaterialComponent = MaterialSelectComponent ;
7581
You can’t perform that action at this time.
0 commit comments