update _currentElement to nextElement to trigger correct event handlers#45
update _currentElement to nextElement to trigger correct event handlers#45davidmarkclements wants to merge 1 commit intoYomguithereal:masterfrom
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
truevalue).This is due to
this._currentElementbeing accessed in the event listener, but not being updated in cases where a re-render leads to the creation of a new element.