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

Make scroll lock div work on a document context it belongs to #5347

Merged
merged 3 commits into from
Sep 20, 2023
Merged

Make scroll lock div work on a document context it belongs to #5347

merged 3 commits into from
Sep 20, 2023

Conversation

aszmyd
Copy link
Contributor

@aszmyd aszmyd commented Sep 16, 2022

Fixes #5346

@changeset-bot
Copy link

changeset-bot bot commented Sep 16, 2022

🦋 Changeset detected

Latest commit: f313a13

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-select Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 16, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit f313a13:

Sandbox Source
react-codesandboxer-example Configuration

@lukebennett88
Copy link
Collaborator

Thanks for your PR @aszmyd.
Could you please create a CodeSandbox example showing the use case you're trying to solve. The code looks pretty straight forward, but I'd like to test it a little more 🙂
Also this PR will require a changeset in order to get merged. If you haven't used changesets before, instructions on how to do that are available here.

@aszmyd
Copy link
Contributor Author

aszmyd commented Sep 20, 2023

I've updated the branch, included the changeset, and prepared two CodeSandbox instances to show the issue:

I also recorded a small demo of the bug (link) - first part shows the behavior on the 5.7.4 version and second (on the second tab of the browser) shows the fix. The bug is that it's not possible to close the opened select by clicking outside of it when the menuShouldBlockScroll option is set to true.

I've used react-new-window package to make a new document context case (it simply opens a new popup window and uses React Portals to render component on it) as I'm using this package also in my current production codebase.

As mentioned in the issue description, the problem only occurs when the menuShouldBlockScroll is set tu true.

Please let me know if there is anything else I do to make this merged. Our application has no workaround for this bug and it's quite annoying for the our users currently.

Thanks

Copy link
Collaborator

@lukebennett88 lukebennett88 left a comment

Choose a reason for hiding this comment

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

Thanks so much for the PR, and for the thorough documentation and examples @aszmyd.
Everything looks good to me, so I'm going to approve and merge it.

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