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

Added placement property to sl-select #687

Merged
merged 3 commits into from
Feb 21, 2022
Merged

Added placement property to sl-select #687

merged 3 commits into from
Feb 21, 2022

Conversation

bunesk
Copy link
Contributor

@bunesk bunesk commented Feb 20, 2022

Hi, I had the following issue:
sl-dropdown has a property placement to set the preferred position of the dropdown.
I also wanted to use this feature for sl-select, but the property doesn't exist there.

To solve this I've added the property placement to sl-select and pass it to the inner sl-dropdown.

@vercel
Copy link

vercel bot commented Feb 20, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/shoelace/shoelace/ACKAeMU852baQZrStKBk6J3f6ozc
✅ Preview: https://shoelace-git-fork-buni48-next-shoelace.vercel.app

@claviska
Copy link
Member

I'm not sure it makes sense to map all possible placements from select to dropdown. Select has logic that ensures its dropdown is the same width as the input, so top-start, top, and top-end are equivalent. Same with the bottom placements. It also seems odd to allow left and right placements for a select.

I'd be OK with allowing top | bottom as a preferred placement because they'll still flip if there's no room in the viewport.

What use case do you have where the current behavior isn't acceptable? If you've placed it low and want it to appear on top, that should happen automatically unless there's enough space in the viewport to render it below.

@bunesk
Copy link
Contributor Author

bunesk commented Feb 21, 2022

I totally agree, everything except top and bottom doesn't make sense.
My use case is that I have two selects which are always near to the bottom next to each other while the one has more options than the other. The one opens at the top the other fits very closely at the bottom. I know this is not really a problem but it's just personal taste that I want both to open at the top in this case.

@bunesk bunesk marked this pull request as draft February 21, 2022 06:35
@bunesk bunesk marked this pull request as ready for review February 21, 2022 06:42
@claviska claviska merged commit b24ff33 into shoelace-style:next Feb 21, 2022
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.

None yet

2 participants