PeterStaev / NativeScript-Drop-Down

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

Keyboard next (tab) focus #126

Closed johnnyzen closed 6 years ago

johnnyzen commented 7 years ago

Hi there

Is is possible to focus the dropdown from the keyboard next button?

On a standard form, natively or html, tabbing would put a box around it.

At the moment, next button just goes to the textfield below the dropdown.

Thanks

PeterStaev commented 7 years ago

Hey @johnnyzen , this is currently not supported. This is mainly because the iOS visual element is based on a UILabel so you cant really have a focus on a label. Web renders the drop down as a textbox and we moved away from that control due to other problems. You will have to manually handle the next button on the previous control, and when pressed to call the open() method of the drop down. Then when the drop down is closed to manually focus your next control.

johnnyzen commented 7 years ago

If you call open on a dropdown which is out of view. it doesnt open, and in Android (sorry my query is just Android) it still tabs to the field underneath anyway (even if I overwrite returnpress)

PeterStaev commented 7 years ago

Then you will have to use the underlying native android object and see how to implement/set the focus to the control. The underlying control is an android Spinner object so if it is possible to focus the control in Android you will be able to do it in {N}, it is just not supported out of the box by the plugin.

PeterStaev commented 6 years ago

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