Skip to content

Add readonly class to SelectField #1148

@niklasdahlheimer

Description

@niklasdahlheimer

I need to add custom text styling to readonly fields. For TextFields this works flawlessly with a selector like

.ui.input input[readonly]{
   color: darkgrey;
}

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 the disabled class, here:

className={classnames({ disabled, error, required }, className, 'field')}

PS: I only could speak for the semantic-ui package here, maybe this affects other packages too.

Metadata

Metadata

Assignees

Labels

Area: ThemeAffects some of the theme packagesTheme: Semantic UIAffects the uniforms-semantic packageType: FeatureNew features and feature requests

Type

No type
No fields configured for issues without a type.

Projects

Status
On Hold

Relationships

None yet

Development

No branches or pull requests

Issue actions