Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

accessibility - aria-label Attribute Not Read by Screen Reader in Ionic 5 ion-input

The aria-label attribute does not seem to be working in an Ionic 5 tag, as it registers as empty with a screen reader. I'm using the Mac OS Accessibility Inspector so I can view and listen to elements as they are read, but the behavior is the same with a device's voiceover app. The aria-label does, however, work in a regular HTML tag. Here's a code example which should be easily reproducible:

  <input aria-label="html input" /><!-- Label is read by screen reader -->
  <ion-input aria-label="ion input"></ion-input><!-- Label is not read by screen reader -->
  <ion-input [attr.aria-label]="'ion input'"></ion-input><!-- Label is not read by screen reader -->

If anyone has run into this before and can recommend a solution it would be appreciated.

Technologies Used:

Ionic CLI : 5.4.16 Ionic Framework : @ionic/angular 5.5.1

Mac OS Accessibility Inspector v5.0

question from:https://stackoverflow.com/questions/65617318/aria-label-attribute-not-read-by-screen-reader-in-ionic-5-ion-input

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...