fix: virtual keyboard on mobile should be based on the allowed keys#4411
Conversation
🦋 Changeset detectedLatest commit: 3862259 The changes in this PR will be included in the next version bump. This PR includes changesets to release 57 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Caution Review failedThe pull request is closed. WalkthroughThis pull request introduces a patch for the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
8942d81 to
644fbe5
Compare
| const isNumeric = (pattern: string) => { | ||
| const numericPattern = /(^|\W)[0-9](\W|$)/; | ||
|
|
||
| return numericPattern.test(pattern) && !/[^\d\^$\[\]\(\)\*\+\-\.\|]/.test(pattern); | ||
| }; | ||
|
|
There was a problem hiding this comment.
@macci001, please move this to the shared-utils package, Also, ensure that the pattern string is validated to confirm it exists (i.e., it should not be null).
There was a problem hiding this comment.
Moved the check function to shared-utils.
Also, I think allowedKeys would not be null as we are setting the default value in L110
59ce0b5 to
6ae4db7
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.changeset/cyan-donkeys-swim.md(1 hunks)packages/components/input-otp/src/use-input-otp.ts(2 hunks)packages/utilities/shared-utils/src/index.ts(1 hunks)packages/utilities/shared-utils/src/regex.ts(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- packages/utilities/shared-utils/src/index.ts
🔇 Additional comments (3)
.changeset/cyan-donkeys-swim.md (1)
1-5: LGTM! Appropriate version bump and clear description.
The patch version bump is correct for this bug fix, and the description clearly links to the issue being fixed.
packages/components/input-otp/src/use-input-otp.ts (2)
16-16: LGTM! Clean import of the new utility.
The isPatternNumeric utility is correctly imported from shared-utils.
249-249: Verify the virtual keyboard behavior on different mobile browsers.
The implementation looks correct, but it's important to verify the behavior across different mobile browsers as they might handle inputMode differently.
Let's check if there are any browser-specific workarounds in the codebase:
Closes #4408
📝 Description
Fixing the virtual keyboard based on the allowedKeys.
⛳️ Current behavior (updates)
VIDEO-2024-12-20-00-34-18.mp4
🚀 New behavior
VIDEO-2024-12-20-00-32-50.mp4
💣 Is this a breaking change (Yes/No): No
Summary by CodeRabbit
New Features
Bug Fixes
Documentation