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

[number-field] Disabled field step buttons almost invisible when value is set #7774

Closed
web-padawan opened this issue Sep 6, 2024 · 0 comments · Fixed by #7775
Closed

[number-field] Disabled field step buttons almost invisible when value is set #7774

web-padawan opened this issue Sep 6, 2024 · 0 comments · Fixed by #7775

Comments

@web-padawan
Copy link
Member

web-padawan commented Sep 6, 2024

Description

The vaadin-number-field has special logic to set disabled on step buttons (and it is also set when host is disabled).
This becomes problematic since there is opacity: 0.2 set on the disabled buttons by the themes:

[part$='button'][disabled] {
opacity: 0.2;
}

As a result, here's the difference of disabled field with and without value:

No value With value
disabled-no-value disabled-value

Expected outcome

Expected the step buttons in the disabled number field to look the same regardless of whether value is present.

This should be probably done by not applying opacity to disabled buttons when the field itself is disabled.

Minimal reproducible example

<-- Correct: no value -->
<vaadin-number-field label="Count" step-buttons-visible disabled></vaadin-number-field>

<-- Incorrect: with value -->
<vaadin-number-field label="Count" step-buttons-visible disabled value="1"></vaadin-number-field>

Steps to reproduce

Add the snippet above to the HTML page, note the difference in step buttons.

Environment

Vaadin version(s): 24.x and earlier

Browsers

Issue is not browser related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant