Skip to content

feat: add indicator part to new fields - #2312

Merged
web-padawan merged 2 commits into
masterfrom
feat/indicator-part
Aug 12, 2021
Merged

web-padawan merged 2 commits into
masterfrom
feat/indicator-part

Conversation

@web-padawan

Copy link
Copy Markdown
Member

Description

  1. Updated the required indicator to use a dedicated HTML element with indicator part
  2. Changed the new fields to use the new indicator (the old ones are still using pseudo element)
  3. Updated Lumo to include fix for incorrect animation by always using padding on the label part.
    See Fix issue #83 required field: indicator jumps when setting required to false vaadin-lumo-styles#92

Fixes #2301
Fixes #1634

Type of change

  • Feature

@hdamr hdamr left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to use VoiceOver with text-field and it didn't read label (maybe I used it wrong) or the content we put after indicator, only said that required text field. If that is the behaviour we want, I think it is good.

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vursen

vursen commented Aug 11, 2021 •

Copy link
Copy Markdown
Contributor

@hdamr May I ask you to provide any information that could help to reproduce the issue you are facing?

Unfortunately, I wasn't able to reproduce the issue you reported in neither of the browsers (Chrome, Safari, Firefox), the label is always announced in my case. I used the following snippet:

<vaadin-text-field label="Label" required></vaadin-text-field>

<script type="module">
  import { TextField } from '@vaadin/text-field';

  customElements.define('vaadin-text-field', TextField);
</script>

image

@hdamr

hdamr commented Aug 12, 2021

Copy link
Copy Markdown
Contributor

@vursen per discussion I had with Serhii, This is the intended correct behaviour.

@web-padawan
web-padawan merged commit d5e9ce1 into master Aug 12, 2021
@web-padawan
web-padawan deleted the feat/indicator-part branch August 12, 2021 06:46
vursen added a commit that referenced this pull request Sep 15, 2026
The padding reserved room for a fading required indicator (#2312).
The indicator no longer has a transition, so non-required labels do
not need it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 70e6d49)
vursen added a commit that referenced this pull request Sep 15, 2026
## Description

Lumo reserves `1em` of end padding on every field label for the required
indicator. The padding comes from vaadin/vaadin-lumo-styles#92 (merged
here in #2312) as a workaround for a fading indicator that jumped when
`required` was toggled. The indicator no longer has a transition, so the
padding serves no purpose on non-required fields, and in the
`label-aside` variant it adds to the gap between the label and the
input. This change applies the padding only under `:host([required])`,
as the base styles do. No Lumo screenshot changed, since the label only
shrinks by the padding, which is not visible unless the label is wider
than the field.

Related to #12729

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y Accessibility issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[text-field] Required indicator is still announced and has click issues Required field: indicator jumps when setting required to false

3 participants