PeterStaev / NativeScript-Drop-Down

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

IOS: When user opens the dropdown, by default, it shows as if first option is selected (highlighted in the dial), when user taps on 'done' button without rolling the dial, then first option is not selected #244

Closed vasudevpareek07 closed 3 years ago

vasudevpareek07 commented 4 years ago

In IOS, When user opens the dropdown, by default it shows as if first option is selected (highlighted in the dial), when user taps on 'done' button without rolling the dial, then first option is not shown as selected in the dropdown field, whereas since it was shown as selected when opening the dropdown, first option should be ideally shown as selected in the dropdown field.

version of "nativescript-drop-down": "7.1.0", version of "nativescript": "6.7.8", version of Angular: "8.2.0"

Any quick help would be appreciated. Thanks.

PeterStaev commented 4 years ago

Hey @vasudevpareek07 , this is how the list component works in iOS. You will have to add a custom not selected value as part of the list and adjust your logic based on that.

vasudevpareek07 commented 4 years ago

@PeterStaev, Thanks for the quick response. Is it possible to style a particular option in dropdown.

PeterStaev commented 4 years ago

Currently this is not possible.

vasudevpareek07 commented 3 years ago

@PeterStaev, I have added a option called as 'Select Client' in the list as first option. I am emitting the data to the parent component if the selectedIndex is greater than 0 in IOS, but when I select the first option ('Select Client'), that value is shown as selected in the dropdown field although I am setting the selectedIndex = null if selectedOption index is 0. Is there any other way I can reset/deselect the selected option ?

PeterStaev commented 3 years ago

No there isn't. That's what I mean that in iOS the list picker always shows the first item as selected, but it can be that it isn't actually selected.

PeterStaev commented 3 years ago

No further response so closing this one for now. In case you still have problems, please provide more details.