curtis-allan / Shad4Fasthtml

Porting Shadcn-ui components to python/js for use with fasthtml
https://shad4fasthtml.com
114 stars 7 forks source link

The Select Component lowercases values #56

Open Daniel-GraphTx opened 1 week ago

Daniel-GraphTx commented 1 week ago

Very helpful project, thank you.

When using the Select component with FastHTML forms one only gets lowercased values from the Select component. Is there any reason to do SelectItem(item, value=item.lower(), name=item) for item in items in the Select component?

For form use it would be nicer not to lowercase the items.

curtis-allan commented 1 week ago

Might be an option, the FT methods are meant to be simple & fast to implement as a boilerplate. Standard method allows for fine-grained control of each element which is why I opted to standardise the value from the name, making them consistent for backend access - but I'll have a think. Thanks for the feedback!

Daniel-GraphTx commented 1 week ago

Makes sense. In my use case I have users enter data in forms and I show it later, so then I have to re-map to the upper-case value for display. Curious to hear where you end up in your thinking.

curtis-allan commented 1 week ago

Makes sense. In my use case I have users enter data in forms and I show it later, so then I have to re-map to the upper-case value for display. Curious to hear where you end up in your thinking.

Ahh I'm following, will add it to the todo list since there's a need :)