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(Popup): fix positioning in scrollable container #4446

Merged
merged 2 commits into from
Dec 10, 2023

Conversation

CoryDuncan
Copy link
Contributor

@CoryDuncan CoryDuncan commented Nov 29, 2023

Fixes #4444

This PR addresses a regression for the Popup component where a Popup inside a non-document scrollable container would not update its position on scroll.

Context:
Popper.JS attempts to find scroll ancestors based on the reference element here: https://github.com/floating-ui/floating-ui/blob/92195083958c9496988ed4526b82b75b7256b5a4/src/createPopper.js#L80-L83.

The problem is that the reference element provided via Popup fails the isElement() check and the fallback, a contextElement property does not exist.

This PR updates ReferenceProxy to add the contextElement property.

Original fix: #3607

Copy link

welcome bot commented Nov 29, 2023

💖 Thanks for opening this pull request! 💖

Here is a list of things that will help get it across the finish line:

  • Run yarn lint locally to catch formatting errors. This will fix some errors automatically, commit and push any changes.
  • Run yarn test locally to catch errors. This ensures all components still behave as they should.
  • Run yarn start to run the doc site locally and try a few pages, ensuring everything is in good working order.
  • Include tests when adding/changing behavior.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

Copy link

codecov bot commented Nov 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (888b2f7) 99.51% compared to head (33bc3b7) 99.51%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4446   +/-   ##
=======================================
  Coverage   99.51%   99.51%           
=======================================
  Files         186      186           
  Lines        3511     3512    +1     
=======================================
+ Hits         3494     3495    +1     
  Misses         17       17           

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

@c3-juanca
Copy link

@CoryDuncan really appreciate your help!

@layershifter what's necessary to get this merge to version 2.1.4?

@layershifter
Copy link
Member

@CoryDuncan thanks ❤️ I will check some PRs/issues this week and trigger a release for next beta in v3.

@CoryDuncan
Copy link
Contributor Author

I will check some PRs/issues this week and trigger a release for next beta in v3.

@layershifter would it be possible to release this as a patch in v2? The project I'm working on is using version 2.1.4 and doesn't have any near term plans to migrate to 3 (at least while it's in beta).

@c3-juanca
Copy link

@layershifter I'm in the same position as Cory. Is it possible to release this as a patch in v2?

@adithya1310
Copy link

@layershifter would it be possible to release this as a patch in v2 itself as we would need this feature to be fixed for our requirement

@layershifter layershifter merged commit 076f818 into Semantic-Org:master Dec 10, 2023
9 of 10 checks passed
Copy link

welcome bot commented Dec 10, 2023

Congrats on merging your first pull request! 🎉🎉🎉

robot victory dance

layershifter pushed a commit that referenced this pull request Dec 10, 2023
Co-authored-by: Oleksandr Fediashov <alexander.mcgarret@gmail.com>
(cherry picked from commit 076f818)
@layershifter
Copy link
Member

@CoryDuncan @c3-juanca @adithya1310 as an exception I released the fix in semantic-ui-react@2.1.5.

@c3-juanca
Copy link

Really appreciate it, @layershifter 🙌

@adithya1310
Copy link

adithya1310 commented Dec 11, 2023 via email

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.

Popup moves as the page scrolls
4 participants