From 11da81c6e2bcdf13289e21b1b2fb3fdd7f1a79ce Mon Sep 17 00:00:00 2001 From: vvadyak Date: Mon, 25 Jun 2018 14:33:34 +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..1139c176 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(); }