Skip to content

Help with making it scrollable on many items #261

Answered by csandman
M1z23R asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not gonna lie, that image made me laugh. Honestly, chakra-react-select might not be the best use case for what you're trying to do. But if you're set on it, you're probably better off not displaying the selected options inside the field itself. This can easily be turned off by setting the prop controlShouldRenderValue={false}.

From there, as long as you're keeping track of your selected options with a state value, you can render them however you want nearby.

Something like this:

Here's a complete example of how you might accomplish this: https://codesandbox.io/s/v65hnp?file=/app.tsx

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by M1z23R
Comment options

You must be logged in to vote
1 reply
@csandman
Comment options

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