Open Gimly opened 7 years ago
I've found out the bug with comparing options. You can fix it by editing already complied file node_modules/ng2-semantic-ui/dist/modules/select/classes/select-base.js change this return options.find(function (o) { return value === _this.valueGetter(o) }); to this return options.find(function (o) { return JSON.stringify(value) === JSON.stringify(_this.valueGetter(o)) });
I'm having an issue when using the
sui-select
component that the selected object that I'm binding to and the list of options are not coming from the same source (even though they are the same objects) and therefore are different instances of the same objects.Angular fixes that by having a
compareWith
property that allows to pass a method that will be called to compare to objects for equality. See https://angular.io/api/forms/SelectControlValueAccessor#caveat-option-selectionIt would be very useful to have that behavior reproduced in the sui-select component. Or maybe there is a workaround that I'm not aware of?