Sorts the selected values in the selected based on their order in the panel.
()
| 1263 | |
| 1264 | /** Sorts the selected values in the selected based on their order in the panel. */ |
| 1265 | private _sortValues() { |
| 1266 | if (this.multiple) { |
| 1267 | const options = this.options.toArray(); |
| 1268 | |
| 1269 | this._selectionModel.sort((a, b) => { |
| 1270 | return this.sortComparator |
| 1271 | ? this.sortComparator(a, b, options) |
| 1272 | : options.indexOf(a) - options.indexOf(b); |
| 1273 | }); |
| 1274 | this.stateChanges.next(); |
| 1275 | } |
| 1276 | } |
| 1277 | |
| 1278 | /** Emits change event to set the model value. */ |
| 1279 | private _propagateChanges(fallbackValue?: any): void { |
no test coverage detected