Add readonly class to SelectField #1148
Labels
Area: Theme
Affects some of the theme packages
Theme: Semantic UI
Affects the uniforms-semantic package
Type: Feature
New features and feature requests
Milestone
I need to add custom text styling to readonly fields. For TextFields this works flawlessly with a selector like
because the readonly attribute is forwarded directly to the
<input>
element. However, for SelectFields the inner HTML element is<select>
. You probably did not forward it here because, according to the specification<select>
elements do not accept the readonly attribute.To respect the specification but still have an anchor for readonly select fields and support css selecting, it would be great if you could add a conditional
readonly
class to the outer div, similar to thedisabled
class, here:uniforms/packages/uniforms-semantic/src/SelectField.tsx
Line 51 in f19cdcb
PS: I only could speak for the semantic-ui package here, maybe this affects other packages too.
The text was updated successfully, but these errors were encountered: