Reproduction link
Steps to reproduce
- Open the minimal reproduction in Google Chrome
- Open the Devtools inspector (key command F12 or right-click and select Inspect)
- Open the Accessibility menu
- Use the Selection tool to select either element
- The Accessibility menu's Computed Properties will update to show the has a Name of "", meaning no accessible name has been provided
What is expected?
The Accessibility menu's Computed Properties should show the Name of the as the value added to the addOnBefore/addOnAfter content, as this content appears to be used as a label for the field
What is actually happening?
The is not associated with the addOnBefore/addOnAfter content, and therefore the Accessibility menu's Computed Properties show the Name as blank, meaning non-visual users have no context for this field's purpose
| Environment | Info |
| ------------ | ------------ |
| antd | 5.12.1 |
| React | 17.0.2 |
| System | MacOS Sonoma 14.1.2 |
| Browser | Chrome 119.0.6045.199 |
This bug was encountered while doing accessibility testing on some ANT components in a product we are maintaining
The addOnBefore/addOnAfter elements could be changed to elements, or:
- the addOnBefore/addOnAfter element could be given unique id attribute, then
- the related could be given an aria-labelledby attribute with a value that matches the unique id on the
Either of these methods will provide the contents of the addOnBefore/addOnAfter content as the accessible name of the field
3条答案
按热度按时间0ejtzxu11#
There is no
addOnBefore
oraddOnAfter
in your codesandbox.kt06eoxx2#
@afc163 apologies, I had attached the incorrect link. I've updated the original comment to a codesandbox with
addonBefore
andaddonAfter
idfiyjo83#
Hello @Watso196. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please send your Pull Request to proper branch (feature branch for the new feature, master for bugfix and other changes), fill the Pull Request Template here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!
你好 @Watso196,我们完全同意你的提议/反馈,欢迎直接在此仓库 创建一个 Pull Request 来解决这个问题。请将 Pull Request 发到正确的分支(新特性发到 feature 分支,其他发到 master 分支),务必填写 Pull Request 内的 预设模板 ,提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献。