Skip to content
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: OTPInput field value clear behaviour changes #2524

Merged
merged 2 commits into from
Feb 7, 2025

Conversation

kabilansakthivelu
Copy link
Contributor

@kabilansakthivelu kabilansakthivelu commented Feb 4, 2025

Description

In OTPInput, when a value is cleared in one of the input field, persisting the focus in the same input field instead of shifting the focus to previous input field

Changes

Current behaviour:

When user wants to update a particular input field value in OTPInput component, the focus gets shifted to previous input field on clearing the value and user have to shift to the corresponding input field again to enter the updated value

Screen.Recording.2025-02-04.at.15.43.43.mov

Changes made:

When Backspace or Delete key is pressed on an input field in OTPInput component,

  • if value existed, then it will be cleared and focus will be persisted on the same input field allowing user to update
  • if value is empty, then focus will be shifted to previous input field and its value will be cleared
Screen.Recording.2025-02-04.at.15.41.19.mov

Additional Information

Component Checklist

  • Update Component Status Page
  • Perform Manual Testing in Other Browsers
  • Add KitchenSink Story
  • Add Interaction Tests (if applicable)
  • Add changeset

Copy link

changeset-bot bot commented Feb 4, 2025

🦋 Changeset detected

Latest commit: 0be0e5a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@razorpay/blade Patch

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

Copy link
Contributor

github-actions bot commented Feb 4, 2025

✅ PR title follows Conventional Commits specification.

Copy link

codesandbox-ci bot commented Feb 4, 2025

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.

Latest deployment of this branch, based on commit 0be0e5a:

Sandbox Source
razorpay/blade: basic Configuration

@rzpcibot
Copy link
Collaborator

rzpcibot commented Feb 5, 2025

Bundle Size Report

Updated Components
Status Component Base Size (kb) Current Size (kb) Diff
Counter 0.849 0.851 +0.002 KB
OTPInput 30.340 30.343 +0.003 KB

Generated by 🚫 dangerJS against 0be0e5a

@saurabhdaware
Copy link
Member

Hi, thanks for the PR. This looks great. I'll just get it reviewed from our design team and update here.

@saurabhdaware saurabhdaware added the Review - Design Waiting for design review label Feb 5, 2025
saurabhdaware
saurabhdaware previously approved these changes Feb 7, 2025
@saurabhdaware saurabhdaware added Review - L2 Second level of review and removed Review - Design Waiting for design review labels Feb 7, 2025
anuraghazra
anuraghazra previously approved these changes Feb 7, 2025
@anuraghazra anuraghazra dismissed stale reviews from saurabhdaware and themself via 0be0e5a February 7, 2025 07:25
@anuraghazra anuraghazra merged commit 6cf03ea into master Feb 7, 2025
12 of 14 checks passed
@anuraghazra anuraghazra deleted the fix/otpInput-clear-behaviour branch February 7, 2025 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review - L2 Second level of review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants