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

Scroll selected option into view when receiving refs #5784

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JefHellemansBlockbax
Copy link

@JefHellemansBlockbax JefHellemansBlockbax commented Oct 19, 2023

@changeset-bot
Copy link

changeset-bot bot commented Oct 19, 2023

⚠️ No Changeset found

Latest commit: d9955af

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 19, 2023

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 d9955af:

Sandbox Source
react-codesandboxer-example Configuration

@JefHellemansBlockbax
Copy link
Author

While looking at this again I noticed that another option is to make these refs part of the state. That way, when they get updated the componentDidUpdate function will trigger, causing the scrollIntoView call in there to be called. That is probably the best solution, and I'm willing to implement it in this PR if that helps. Feedback on both ideas (or either one really) would be much appreciated. We would love to get an updated version of react-select released in our product, as this functionality is currently broken for us. Based on the issues linked, it looks like we won't be the only ones benefitting from this change.

For now we'll implement a patch in our own code base, but that is something we would rather get rid of as soon as possible.

@JefHellemansBlockbax JefHellemansBlockbax force-pushed the Fix-scrolling-selected-option-into-view-for-MenuPortals branch from 02d80ba to c3b8905 Compare November 9, 2023 13:33
@JefHellemansBlockbax JefHellemansBlockbax force-pushed the Fix-scrolling-selected-option-into-view-for-MenuPortals branch from c3b8905 to d9955af Compare November 14, 2023 07:56
madelahsan

This comment was marked as off-topic.

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.

3 participants