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

fix(Visibility): context changes cause memory leak and incorrect scroll events #2458

Merged
merged 1 commit into from
Jan 25, 2018

Conversation

fracmak
Copy link
Member

@fracmak fracmak commented Jan 23, 2018

There's a couple of bugs in visibility regarding custom contexts.

  • If the context changes through a prop update, we leak the original scroll and resize handlers because on unmount, we look at the current context prop and unsub that, instead of what was originally sub'd
  • If we provide a null context (like if the ref={} call is delayed), we listen to document scroll events and never listen to the scroll events of the context. Along those lines, I'm assuming sending the document scroll events are incorrect and shouldn't be sent to the onUpdate handler, but I'm open to arguments otherwise

@fracmak fracmak force-pushed the visibility-context-bugs branch from 46ab0c6 to e52d2fa Compare January 23, 2018 20:36
@levithomason
Copy link
Member

Superb. Thanks for the excellent PR.

@levithomason levithomason merged commit aed4f01 into Semantic-Org:master Jan 25, 2018
Brantron pushed a commit to Brantron/Semantic-UI-React that referenced this pull request Mar 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants