petalframework / petal_components

Phoenix + Live View HEEX Components
https://petal.build/components
MIT License
768 stars 84 forks source link

input fields components ignores class attributes #238

Closed sezaru closed 11 months ago

sezaru commented 11 months ago

Some of the input components, for some reason, ignore some of the passed attributes, more specifically, the select and textarea inputs ignore the passed class attribute:

https://github.com/petalframework/petal_components/blob/23c9c4312033e4b3d74a769faa309c646b3f593c/lib/petal_components/input.ex#L46 https://github.com/petalframework/petal_components/blob/23c9c4312033e4b3d74a769faa309c646b3f593c/lib/petal_components/input.ex#L55

Why is that? Why can't these inputs just merge the user classes with the default one instead of replacing it?

Just to give a scenario for why I need this. I want a select input where I want to remove border radius for the top and bottom left side, so I'm trying to pass class="rounted-r-none" to the input component, but, as shown in the above code lines, this will just be ignored.

mplatts commented 11 months ago

Yeah you're right, it should merge the class attributes.

nhobes commented 11 months ago

This has been fixed in 1.4.3, thanks for reporting!