From 3d61466731264de128bab58958ddd5ece0ef512e Mon Sep 17 00:00:00 2001 From: vvadyak Date: Mon, 25 Jun 2018 17:53:21 +0300 Subject: [PATCH] Update select.ts Highlight selected item in the list instead of selecting the first one by default --- src/select/select.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/select/select.ts b/src/select/select.ts index 2bbe3d3d..3474f818 100755 --- a/src/select/select.ts +++ b/src/select/select.ts @@ -663,7 +663,11 @@ export class GenericBehavior extends Behavior implements OptionsBehavior { } public first(): void { - this.actor.activeOption = this.actor.options[0]; + if (this.actor.active.length > 0) { + this.actor.activeOption = this.actor.active[0]; + } else { + this.actor.activeOption = this.actor.options[0]; + } super.ensureHighlightVisible(); }