svelte-ux
svelte-ux copied to clipboard
[SelectField] Standardize with MenuField / general improvements
Extracted from PR #130
- [x] Use same Options type instead of any
- Will use
label
instead ofname
by default (can still be overwritten byoptionText()
, maybe we call thisoptionLabel()
, or maybe we require the data to be processed ahead of time and remove this andoptionValue()
- Will use
- [ ] Pass
icon
prop to MenuItem like MenuField - [x] Should we update the
<SelectField icon={...} />
based on the selected<MenuItem icon={...} />
?- Add a prop to opt-in to this functionality (
activeOptionIcon
or something) - Require the user to do this (like the SelectField example currently does.
- Add a prop to opt-in to this functionality (
- [ ] Fix clicking on Chevon icon/button to close (re-toggles open) (#93)
The first task is also in the Road to v1 issue
Task 1 and 3 resolved via https://github.com/techniq/svelte-ux/pull/127.
@willnationsdev Tagging you here if you're interested in knocking out these, but don't feel like you have to.
Got a PR, but even with the icons added back in, the blue coloration they had before on the docs page is now gone. I'd bet there're styles somewhere in the docs that need to be adjusted. Cause you wouldn't wanna make a change like that to the component itself or to the theme that applies to everyone's usage of the SelectField's MenuItems - you just want the docs page. But the docs page didn't appear to have Tailwind classes is was merging in via attributes, so idk where those styles came from.