-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: improve OTP Delete keydown #48866
Conversation
Run & review this pull request in StackBlitz Codeflow. |
👁 Visual Regression Report for PR #48866 Passed ✅
🎊 Congrats! No visual-regression diff found. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #48866 +/- ##
===========================================
- Coverage 100.00% 99.96% -0.04%
===========================================
Files 746 746
Lines 12994 13001 +7
Branches 3411 3413 +2
===========================================
+ Hits 12994 12997 +3
- Misses 0 4 +4 ☔ View full report in Codecov by Sentry. |
@@ -249,6 +249,7 @@ const OTP = React.forwardRef<OTPRef, OTPProps>((props, ref) => { | |||
onActiveChange={onInputActiveChange} | |||
autoFocus={index === 0 && autoFocus} | |||
{...inputSharedProps} | |||
__internalLastIndex={length - 1} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 prop 命名很奇怪。
有点曲解了设计,现在每个 input 其实是 autoselect 的。 后面看看有没有其他人有类似的需求吧~ |
It seems like there is also a validation problem:
|
中文版模板 / Chinese template
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
按下键盘Delete 时应该删除后一项?
📝 Changelog
☑️ Self-Check before Merge