segmentio / evergreen

🌲 Evergreen React UI Framework by Segment
https://evergreen.segment.com
MIT License
12.39k stars 832 forks source link

Add a flag that allows you to disable scrolling to the selected option #1478

Open Ageoshka opened 2 years ago

Ageoshka commented 2 years ago

Overview Hello everyone  ~~~~ I added the loading of new options by scrolling in my project. Therefore, I am adding an option shouldScrollToSelectedOnRender to SelectMenu that allows you to disable scrolling to the selected option. If I understood correctly, scrolling to the selected element is needed only in case when a window opens with options. Please correct me if there are other cases.

Screenshots (if applicable)

Documentation

netlify[bot] commented 2 years ago

Deploy Preview for evergreen-storybook ready!

Name Link
Latest commit 99ff73a19da58140fdebf82cf7bf8d898ce0b8b4
Latest deploy log https://app.netlify.com/sites/evergreen-storybook/deploys/62a1f5f7f325330008835ddc
Deploy Preview https://deploy-preview-1478--evergreen-storybook.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

brandongregoryscott commented 2 years ago

Hey @Ageoshka - apologies for the delay on responding here. Can you provide an example CodeSandbox that demonstrates the undesirable behavior that you're looking to change? I've whipped up a minimal template that might help: https://codesandbox.io/s/create-react-app-evergreen-starter-ts-3q99w