PeterStaev / NativeScript-Drop-Down

A NativeScript DropDown widget.
Apache License 2.0
105 stars 65 forks source link

[Android]All closed event handler of DropDown will be triggered when any single one dropdown is closed #242

Closed rsun-thoughtworks closed 4 years ago

rsun-thoughtworks commented 4 years ago

nativescript-drop-down

version: 5.0.4

condition

Using angular && nativescript-drop-down,

I have 3 drop downs, and all of them have an closed event handler, lets say A,B,C

When I click A and choose on option(for iOS, I hit Done).

What I expected

Only the closed handler of A is triggered.

Actually

All 3 closed event handler are triggered.

rsun-thoughtworks commented 4 years ago

Update

<DropDown formControlName="bookOfMine1" [items]="books"
                          itemsTextAlignment="center"
                          (closed)="play1($event)"
                          [nsform]="form"
></DropDown>
<DropDown formControlName="bookOfMine2" [items]="books"
                          itemsTextAlignment="center"
                          (closed)="play2($event)"
                          [nsform]="form"
></DropDown>
<DropDown formControlName="bookOfMine3" [items]="books"
                          itemsTextAlignment="center"
                          (closed)="play3($event)"
                          [nsform]="form"
></DropDown>

And play1, play2, play3 are handlers of the closed events.

What I Do, and what happend, In order of time.

I choose one book of bookOfMine1, play1 triggered I choose one book of bookOfMine2, play1, play2 triggered I choose one book of bookOfMine3, play1, play2, play3 triggered Than, I choose one book of bookOfMine1 again, play1, play2, play3 triggered

This is a bug

rsun-thoughtworks commented 4 years ago

Thanks to the owner's quick response, I can close this issue now.