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

Use ResizeObserver to auto-update menu position if available #5404

Merged
merged 2 commits into from
Oct 20, 2022

Conversation

Methuselah96
Copy link
Collaborator

Fixes #5403.

I mistakenly thought in #5381 that the resize event was placed on the control element, but's it really just on the scroll parents of the control element.

This PR enables ResizeObserver if it's available. The referenced issue demonstrates a good use-case for it.

Fixes #5403.

I mistakenly thought in #5381 that the resize event was placed on the control element, but's it really just on the scroll parents of the control element.

This PR enables `ResizeObserver` if it's available. The referenced issue demonstrates a good use-case for it.
@changeset-bot
Copy link

changeset-bot bot commented Oct 20, 2022

🦋 Changeset detected

Latest commit: 1299fe9

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

@Methuselah96 Methuselah96 changed the title Use ResizeObserver to update menu position if available Use ResizeObserver to auto-update menu position if available Oct 20, 2022
@codesandbox-ci
Copy link

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 1299fe9:

Sandbox Source
react-codesandboxer-example Configuration
react-select-v5-sandbox (forked) Issue #5403

@Methuselah96 Methuselah96 merged commit ebb0a17 into master Oct 20, 2022
@Methuselah96 Methuselah96 deleted the use-resize-observer-if-available branch October 20, 2022 12:48
@github-actions github-actions bot mentioned this pull request Oct 20, 2022
Rall3n pushed a commit to Rall3n/react-select that referenced this pull request Oct 21, 2022
…on#5404)

* Use ResizeObserver to update menu position if available

Fixes JedWatson#5403.

I mistakenly thought in JedWatson#5381 that the resize event was placed on the control element, but's it really just on the scroll parents of the control element.

This PR enables `ResizeObserver` if it's available. The referenced issue demonstrates a good use-case for it.

* Create tricky-books-design.md
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.

Select menu portal does not move after selection several options
2 participants