mirror of
https://github.com/kusti8/proton-native.git
synced 2026-05-15 14:15:50 -06:00
[GH-ISSUE #171] Area.Text does not update #109
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#109
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 @grimmen on GitHub (Aug 25, 2018).
Original GitHub issue: https://github.com/kusti8/proton-native/issues/171
In the sample below, when the button is clicked only the first text line changes in the UI. The Area.Text component keeps displaying the initial value.
@mischnic commented on GitHub (Aug 26, 2018):
@kusti8 The problem seems to be that the AreaText class implements only
appendChild, sothis.childrendoesn't update?@kusti8 commented on GitHub (Aug 28, 2018):
Yeah, the reconciler depends on removeChild as well for mutation, which Area.Text doesn't have.
https://github.com/kusti8/proton-native/blob/master/src/reconciler/index.js#L79-L89
A reference on what DesktopComponent does:
https://github.com/kusti8/proton-native/blob/master/src/components/DesktopComponent.js#L74-L108
@mischnic commented on GitHub (Aug 28, 2018):
I fixed a crash regarding conditional rendering in an AreaGroup along the
way, but
removeChildis never getting called in AreaText (thoughappendChildis). I can only pick up the change inAreaText.update(oldProps, newProps).Gustav Hansen notifications@github.com schrieb am Di., 28. Aug. 2018,
16:22:
@kusti8 commented on GitHub (Aug 28, 2018):
That makes sense. If any props are being changed (including children), then update is being called. If we're actually adding or removing children, then removeChild is called. Sorry about that.
So we would have to create an update function. I haven't played with Area as much, but it looks like we just use deleteString and then append the new string?
@mischnic commented on GitHub (Aug 29, 2018):
I think I fixed it locally, but it might be a while before I have internet access to create a PR.