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

chore(Popup): replace event-stack #4499

Conversation

dominikdosoudil
Copy link
Contributor

I think that removing event-stack might be better done incrementally as each the components are independent.

I've replicated that Popup only listens for scroll when the Popup is open and enabled.
I would prefer the whole useEffect hidden under the condition however that might require much more refactoring. This way it's cleaner to see what happened in the diff. Let me know the other way would be preferred.

Copy link

vercel bot commented Nov 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
semantic-ui-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 13, 2024 3:08pm

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.53%. Comparing base (d70adfc) to head (d912d6a).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4499      +/-   ##
==========================================
+ Coverage   99.50%   99.53%   +0.02%     
==========================================
  Files         186      186              
  Lines        3465     3463       -2     
==========================================
- Hits         3448     3447       -1     
+ Misses         17       16       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

… rid of hacky timout that causes remounting Portal component.
@dominikdosoudil
Copy link
Contributor Author

Because of codecov's complaining about the uncovered setTimeout, I've decided to try to get rid of it as it seems to be hacky and not much clear what it does.

As I understood, it causes the Portal component to remount for a moment (50ms) which causes it's inner state reset which causes visually closing the popup even if Popup's state "closed" is false. There were 2 cleaner ways how to do that IMO: fully control open state of Portal (which seemed to be not so easy) or let Portal handle the scroll event and close it's inner state and even propagate it via the onClose handler (because it's all there). It appears to me that this approach works well, no weird timeout, and even the functionality can be reused more.

Copy link
Member

@layershifter layershifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some nits, LGTM overall, great progress ❤️

@layershifter layershifter changed the title Replace event-stack in Popup chore(Popup): replace event-stack Nov 13, 2024
@layershifter layershifter merged commit 80a60c9 into Semantic-Org:master Nov 13, 2024
10 checks passed
Copy link

welcome bot commented Nov 13, 2024

Congrats on merging your first pull request! 🎉🎉🎉

robot victory dance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants