-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Consolidate dropdowns #4934
base: master
Are you sure you want to change the base?
Consolidate dropdowns #4934
Conversation
|
Merged master to get 281f3ec in order for preview image to build 👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impressive work jumping through all the hoops along the way 😀
All three dropdowns seem to work well.
Nitpicks below - feel free to ignore and merge as-is:
-
There's a shaky glitch sometimes when hiding the dropdown by clicking away.
record-2025-01-06-06-50-01-foci.ante.ever.mp4
-
To hairsplit a bit: mixed feelings about the
:button
slot name, mostly because we have abutton
component - not sure I can come up with a better name, but maybe something like:toggler
?- Similarly, maybe
dropdown_item
could be turned into an:item
(or:option
- to follow standard HTMLselect
convention) slot, since it's never meant to be used outside of a dropdown? And following up on that, the divider could be controlled via:item
's attribute?
- Similarly, maybe
Not that I know of - the |
Thanks @aerosol
Can't reproduce myself unfortunately. Can you try again with 0fd45da?
Yeah I agree something like
I didn't find a way to render nested slots with Liveview ( |
Ah 🤦♂️ - let's just not, this is great as is. |
Did try, same thing. Only on Firefox though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes
This only applies to Phoenix/Liveview frontend area.
3.1 Menu is positioned automatically. This is overridden in nav header due to the trigger having very large padding
3.2 Menu will size itself based on the width of its contents. Can be overridden with
max-w-[x]
andmin-w-[x]
.3.3 Menu and items come with default styling now
3.4 Adds disabled state to dropdown item, and a tailwind variant to be able to easily target it
Do we have any other hand-rolled dropdowns in the app that should be consolidated here?
Future possibilities:
<.dropdown_button>
component which will render a<.button>
. Needs some work on the button component itself because buttons in general are quite varied.