mirror of
https://github.com/kusti8/proton-native.git
synced 2026-05-15 14:15:50 -06:00
[GH-ISSUE #158] Picker onSelect returns index, not value #101
Labels
No labels
bug
documentation
enhancement
libui issue
pull-request
question
wait for libui implementation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/proton-native#101
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @n8jadams on GitHub (Jun 17, 2018).
Original GitHub issue: https://github.com/kusti8/proton-native/issues/158
Here is my code that I used to test out the
Pickercomponent:Is it possible to extract the text from the selected
Picker.Item? In this example "Option 1, 2, etc...".I can only get the index... which is useful, but I also wanted the value at the selected index.
I tried adding another argument to the
setMessagefunction and that was alwaysundefined.I also tried making a
reffor the Picker... but got confused as to how to navigate therefand virtualDOM...If there is a solution to this, it would be great to add to the docs!
Out of all the JS libraries for desktop apps, this is my favorite, even though it's still just getting started. :) Thanks!
@mischnic commented on GitHub (Jun 17, 2018):
You could do this as a workaround:
There is no such thing as a DOM for the native UI.
Yes, the docs should refer to the "(selection) index" rather than the "selection".
And this should be "number" instead of "bool":
a938308d14/docs/component_APIs/picker.md (L63-L69)@n8jadams commented on GitHub (Jun 17, 2018):
I was about to add that workaround for this scenario that I figured out myself and then you edited your reply, haha. Nice work. Thanks for the help!
@khanhas commented on GitHub (Jun 18, 2018):
@mischnic And
texttype should bestring