You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: expose the selected label as the value of a select-only combobox - #1259
In Ant Design's Basic Usage example, the selected option is visible next to the read-only input. Tabbing into the control exposes a focused combobox with an empty value. Its selected label is available separately in a polite live region.
For a single select with search disabled, this change gives the built-in input the selected string or numeric label as its native value. The existing label still handles visual rendering. The live region is skipped when the input already exposes the selection. Searchable inputs keep their query, and rich labels and custom inputs keep their existing announcement behavior.
I tested antd 6.7.1 with the released select package and with this patch in Chromium 156 on macOS. With a field labelled Owner, the accessibility tree showed:
Action
1.12.0 combobox value
Patched combobox value
Tab to the field with Lucy selected
Empty
Lucy
Select Jack with the keyboard
Empty
Jack
Activate Clear
Empty
Empty
Type j in a separate searchable field
j
j
The field name stayed Owner after selection. Validation covered the browser accessibility tree. The exact VoiceOver announcement still needs confirmation on a screen-reader setup.
The regression test fails on master with an empty value for Lucy. All 453 tests and 21 snapshots pass with the patch. TypeScript, lint and compilation also pass.
Select-only comboboxes now expose the selected text or numeric label as the input value, and the live region is skipped when the input already exposes it. No concrete merge-blocking risk remains. The actual screen-reader announcement is still to be confirmed on a real setup.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
标题“fix: expose the selected label as the value of a select-only combobox”与变更内容一致。变更在无搜索的单选模式下,把已选文本标签(字符串或数字)作为内置输入框的 value 暴露出来。SingleContent 使用 readOnlyValue 设置输入值,BaseSelect 计算该值并通过上下文传递,同时在该值已定义时抑…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
标题“fix: expose the selected label as the value of a select-only combobox”与变更内容一致。变更在无搜索的单选模式下,把已选文本标签(字符串或数字)作为内置输入框的 value 暴露出来。SingleContent 使用 readOnlyValue 设置输入值,BaseSelect 计算该值并通过上下文传递,同时在该值已定义时抑制 Polite 输出。新增的无障碍测试也覆盖了该行为。标题简洁,说明了主要变更。
Finishing Touches
Generate unit tests (beta)
Create a new PR
Fix failing CI checks
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
我是兔子,蹦到选择框旁, 看见 Lucy,标签写进输入行。 数字零也变成清楚的字, 搜索时,输入仍听从键盘。 非文本标签,让 live region 轻声报上。
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 82ac5aea-1987-40ae-96b3-1b4669c199bb
Commits
Reviewing files that changed from the base of the PR and between fcbd87e and 06a8cba.
Files selected for processing: 4
src/BaseSelect/index.tsx
src/SelectInput/Content/SingleContent.tsx
src/hooks/useBaseProps.ts
tests/Accessibility.test.tsx
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to ant-design/ant-design#52987.
In Ant Design's Basic Usage example, the selected option is visible next to the read-only input. Tabbing into the control exposes a focused combobox with an empty value. Its selected label is available separately in a polite live region.
For a single select with search disabled, this change gives the built-in input the selected string or numeric label as its native value. The existing label still handles visual rendering. The live region is skipped when the input already exposes the selection. Searchable inputs keep their query, and rich labels and custom inputs keep their existing announcement behavior.
I tested antd 6.7.1 with the released select package and with this patch in Chromium 156 on macOS. With a field labelled
Owner, the accessibility tree showed:jin a separate searchable fieldThe field name stayed
Ownerafter selection. Validation covered the browser accessibility tree. The exact VoiceOver announcement still needs confirmation on a screen-reader setup.The regression test fails on master with an empty value for Lucy. All 453 tests and 21 snapshots pass with the patch. TypeScript, lint and compilation also pass.
Summary by CodeRabbit
0。