Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disabled variant in form controls #3092

Open
GalacticHypernova opened this issue Jan 13, 2025 · 1 comment
Open

disabled variant in form controls #3092

GalacticHypernova opened this issue Jan 13, 2025 · 1 comment
Labels
enhancement New feature or request triage v3 #1289

Comments

@GalacticHypernova
Copy link

GalacticHypernova commented Jan 13, 2025

Description

Related: #2907

For many form controls, such as buttons, inputs, checkboxes, radio buttons, text areas, and more, there is no need to have stylistic handling of disabled states by default as they mostly will never reach it.

If we take for example the most common type of online forms, the registration/login form, there is typically an email input and a password input, none of which will ever be disabled. Having the disabled styling on them simply results in more clutter in the HTML and larger payloads, thus reducing performance.

And this doesn't even touch on other use cases of form controls that can never be disabled as per the spec, like using UButton's builtin navigation support when making aesthetic links to other content.

A big performance improvement can be made in this aspect by introducing a new disabled variant for form controls that will be false by default. Only if explicitly set on will it add all styling related to the disabled state.

Additional context

No response

Copy link
Member

We could get rid of all disabled: classes indeed but this would require a big refactor. I'll try to do this when I have some time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage v3 #1289
Projects
None yet
Development

No branches or pull requests

2 participants