fix: remove tabIndex={-1} from clear button to make it keyboard accessible#168
fix: remove tabIndex={-1} from clear button to make it keyboard accessible#168cyphercodes wants to merge 1 commit intoreact-component:masterfrom
Conversation
…sible
The clear button had tabIndex={-1} which made it unreachable via keyboard
navigation, violating WCAG 2.1 success criteria 2.1.1 and 2.1.3.
This change makes the clear button focusable so keyboard users can
access and operate this functionality.
Fixes ant-design/ant-design#57378
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the keyboard accessibility of the clear button within the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
走查从 更改
代码审查工作量🎯 1 (平凡) | ⏱️ ~3 分钟 可能相关的 PR
建议的审查者
诗歌
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |

This PR removes the
tabIndex={-1}from the clear button in BaseInput component.Problem
The clear button had
tabIndex={-1}which made it unreachable via keyboard navigation. This violates WCAG 2.1 success criteria 2.1.1 (Keyboard) and 2.1.3 (Keyboard No Exception), creating inequality for keyboard users who cannot access and operate this functionality.Solution
Remove the
tabIndex={-1}attribute so the clear button becomes focusable by default. This allows keyboard users to tab to the clear button and activate it.Related Issue
Fixes ant-design/ant-design#57378
Note
After this change, ant-design will need to add proper
:focusstyles for the clear button in their style file (components/input/style/index.ts-genAllowClearStylefunction) to ensure the focus state is visually identifiable.Summary by CodeRabbit
发布说明