Skip to content
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

Bug: Put contentRef in state to let EventStack track changes #4388

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 13, 2022

  1. Bug: Put contentRef in state to let EventStack track changes

    contentRef is passed to EventStack to subscribe for mouse events.
    Passing a `contentRef` created using `React.createRef()` does not allow
    EventStack to keep track of contentRef changes (since only
    contentRef.current changes).
    Ultimately when PortalInner unmount contentRef.current is set to undefined
    and EventStack `unsubscribe` handlers with `undefined` as
    a target instead of unsubscribing with real content.
    This leads to the event-stack Map keeping a reference to the real contentRef
    thus leaking all dom tree related to the node related to contentRef.
    
    Putting contentRef in the state and passing the element allow for
    EventStack to detect change in props and execute the componentDidUpdate
    routine which unsubscribe from the previous element on unmount.
    GuiCodron committed Oct 13, 2022
    Configuration menu
    Copy the full SHA
    0113b04 View commit details
    Browse the repository at this point in the history