fix: clear enter lock when select is disabled - #1248
Conversation
|
@dogledogle is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. Walkthrough当 ChangesSelect 键盘交互
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This is a localized fix for clearing stale Enter-key state when a Select becomes disabled, with a regression test added; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
修复 Select 在异步更新过程中被设为
disabled后,Enter 键状态未正确重置的问题。当用户通过搜索并按 Enter 选择选项时,如果
onChange中立即将 Select 设为 disabled,输入框可能不会触发后续的keyup或blur事件,导致 Enter 锁状态残留。重新启用 Select 后,用户需要按两次 Enter 才能完成下一次选择。本次修改会在 Select 进入 disabled 状态时主动清理 Enter 锁,并新增回归测试,确保连续搜索选择只需按一次 Enter。
相关 issue:#51716
Summary by CodeRabbit
Bug Fixes
Tests