Skip to content

Commit 85abd80

Browse files
authored
fix(VField): Fix label accessibility (#21706)
1 parent 4bae0bc commit 85abd80

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/vuetify/src/components/VField/VField.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ export const VField = genericComponent<new <T>(
299299
class={[textColorClasses.value]}
300300
floating
301301
for={ id.value }
302+
aria-hidden={ !isActive.value }
302303
style={ textColorStyles.value }
303304
>
304305
{ label() }
@@ -396,7 +397,7 @@ export const VField = genericComponent<new <T>(
396397

397398
{ hasFloatingLabel.value && (
398399
<div class="v-field__outline__notch">
399-
<VFieldLabel ref={ floatingLabelRef } floating for={ id.value }>
400+
<VFieldLabel ref={ floatingLabelRef } floating for={ id.value } aria-hidden={ !isActive.value }>
400401
{ label() }
401402
</VFieldLabel>
402403
</div>
@@ -407,7 +408,7 @@ export const VField = genericComponent<new <T>(
407408
)}
408409

409410
{ isPlainOrUnderlined.value && hasFloatingLabel.value && (
410-
<VFieldLabel ref={ floatingLabelRef } floating for={ id.value }>
411+
<VFieldLabel ref={ floatingLabelRef } floating for={ id.value } aria-hidden={ !isActive.value }>
411412
{ label() }
412413
</VFieldLabel>
413414
)}

packages/vuetify/src/components/VField/VFieldLabel.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export const VFieldLabel = genericComponent()({
2727
props.class,
2828
]}
2929
style={ props.style }
30-
aria-hidden={ props.floating || undefined }
3130
v-slots={ slots }
3231
/>
3332
))

0 commit comments

Comments
 (0)