-
Notifications
You must be signed in to change notification settings - Fork 36
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
Can't force svelte-multiselect box to not grow #255
Comments
I didn't look into that yet mostly because I really dislike tweaking CSS and that I'm never sure any changes I make would be a general improvement or just for the case I'm currently looking at (different width and height of options, page layout, etc. might need different settings). But I agree the default behavior could be much better. For the time being, the idea is that users pass these CSS variables to tweak the layout to their liking. <MultiSelect
--sms-width="300px"
--sms-max-width="300px"
--sms-min-height="30px"
/> To turn |
Sorry, was a bit late last night. The code snippet I pasted above had the wrong syntax for passing CSS variables. I fixed it. The height issue should be easy to fix with e.g. I think you can fix the missing "x" button to remove selected options by passing a ulSelectedClass="!flex-nowrap !text-ellipsis !overflow-hidden"
liSelectedClass="!bg-red-100 !text-ellipsis !overflow-hidden " |
Could you post a REPL link that reproduces your problem? Bit hard to work from a screenshot. |
Ah, sorry, of course, does this help? |
@paul-brenner I think you posted the wrong link? All I see is a counter in that StackBlitz. |
Ah sorry, should work now, same link: #255 |
Perhaps just me not understanding something fundamental. But I am yet to find a way to force a svelte-multiselect box to stay a fixed size. I see in examples like https://awesome-sveltekit.janosh.dev/ that e.g. selecting options for "Filter by tag" just causes that box to grow in both width and height which pushes the rest of the page around. Am I missing a way to not let that happen?
I'm not 100% sure what should happen instead. I was trying to think if there is some way to just abbreviate the selected options when they take up too much space. e.g. if I selected "blog" and "animations" and there wasn't enough space for both then animations would become "anim..." or just "anim".
But I also see that just selecting "blog" causes the select box to get wider even though there is plenty of empty space and I'm not sure what is driving that or if I can force it to stop.
I should also say upfront that I'm a daisyUI/Tailwindcss user so if there is an existing option I would be trying to figure out how to convert it to work with Tailwind.
The text was updated successfully, but these errors were encountered: