Skip to content

Commit 1105136

Browse files
committed
fix: don't sort values in non-multiple mode
1 parent c2ac75c commit 1105136

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib/select/select.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,10 @@ export class MdSelect implements AfterContentInit, ControlValueAccessor, OnDestr
579579
* order that they have in the panel.
580580
*/
581581
private _sortValues(): void {
582-
const options = this.options.toArray();
583-
this._selectionModel.sort((a, b) => options.indexOf(a) - options.indexOf(b));
582+
if (this._multiple) {
583+
const options = this.options.toArray();
584+
this._selectionModel.sort((a, b) => options.indexOf(a) - options.indexOf(b));
585+
}
584586
}
585587

586588
/** Unsubscribes from all option subscriptions. */

0 commit comments

Comments
 (0)