mirror of
https://github.com/kusti8/proton-native.git
synced 2026-05-15 22:02:24 -06:00
[GH-ISSUE #108] onChange on initial start #65
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#65
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 @mischnic on GitHub (May 5, 2018).
Original GitHub issue: https://github.com/kusti8/proton-native/issues/108
The onChanged event gets emitted when rendering the element for the first time (without any user interaction).
Without typing anything:
@kusti8 commented on GitHub (May 5, 2018):
I suspect this is due to the fact that it creates the onCreate callback before setting the text, simply because that's the order the props are given in. There really isn't an easy way to do this, unless you manually change the prop order which is a bit of a hack.
@mischnic commented on GitHub (May 5, 2018):
onChangegets fired inDesktopComponent.initialProps:d37dae1299/src/components/DesktopComponent.js (L200-L213)@kusti8 commented on GitHub (May 5, 2018):
Yeah so once it sets the onChange callback, it sets the children as well. So if libui fires onChange when the text property is set, then that may be it. I still have to try it out and see.
@mischnic commented on GitHub (May 5, 2018):
It's libui-node('s "fault"):
libui itself doesn't call
onChangedwithsetText.@kusti8 commented on GitHub (May 6, 2018):
Yeah that makes sense. It's not that big of a deal and it would be ugly to fix it in proton-native. For some applications that store the value, it may be desirable so that you get the default value, others not so much.
@parro-it commented on GitHub (May 7, 2018):
We can remove the callback change from the setter of property if you think it can improve things.