-
-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update _currentElement to nextElement to trigger correct event handlers #45
base: master
Are you sure you want to change the base?
Conversation
btw this will cause a merge conflict with #38 - in this case we just need to take both sides of the conflict |
@Yomguithereal - would a hangouts session with explanations help to clear these PR's? |
Just need time. Can you just tell me whether your open PRs are all still relevant and not conflicting with each other? |
no conflicts, other than the merge conflict noted above - all very much relevant I have a patches branch with them all working together https://github.com/davidmarkclements/react-blessed/tree/patches |
Isn't setting |
potentially - I've not experienced any as yet. If you don't do it there are already known side effects (firing old handlers) - ideally we want to update the element in place instead of creating new elements, in which case this wouldn't be needed - could just use as a stop gap |
ping :) |
So here we are speaking of an event triggered before rendering has been completed?
Are the elements not updated but replaced? |
I merged #38. Can you re-test the issue of this PR and tell me if this fix is still relevant please? |
Any news @davidmarkclements? |
it seems in some cases old event handlers from a prior render are triggered instead of the latest event handlers - this includes an event handler that accesses a scope reference, the value of the reference from a prior render applies instead of the most up to date reference (e.g. a boolean may have changed from true to false, but the old event handler still references the old
true
value).This is due to
this._currentElement
being accessed in the event listener, but not being updated in cases where a re-render leads to the creation of a new element.