From a251fe9d1dd1651b6262aa0d3bb1ec3f79766f19 Mon Sep 17 00:00:00 2001 From: Libor Zoubek Date: Fri, 30 Sep 2016 22:57:36 +0200 Subject: [PATCH] (fix) remove handle click behaviour on single mode Pass correct active item when remove handle is clicked in single mode. Prevent dropdown popup when clicking on remove handle. --- components/select/select.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/select/select.ts b/components/select/select.ts index 09928f9b..45516b9d 100755 --- a/components/select/select.ts +++ b/components/select/select.ts @@ -122,7 +122,7 @@ let styles = ` [innerHTML]="sanitize(active[0].text)"> - + @@ -183,7 +183,7 @@ let styles = ` [ngClass]="{'btn-default': true}"> × + (click)="removeClick(a, $event)">× {{a.text}} @@ -481,6 +481,11 @@ export class SelectComponent implements OnInit { return this.activeOption.text === value.text; } + protected removeClick(value: SelectItem, event: any): void { + event.stopPropagation(); + this.remove(value); + } + private focusToInput(value:string = ''):void { setTimeout(() => { let el = this.element.nativeElement.querySelector('div.ui-select-container > input');