fix(input-otp): enforce LTR layout direction in RTL contexts#11203
Open
saadpocalypse wants to merge 1 commit into
Open
fix(input-otp): enforce LTR layout direction in RTL contexts#11203saadpocalypse wants to merge 1 commit into
saadpocalypse wants to merge 1 commit into
Conversation
Contributor
|
@saadpocalypse is attempting to deploy a commit to the shadcn-pro Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In Right-to-Left (RTL) layout contexts (such as
dir="rtl"or RTL document locales),InputOTPslots and typed digits were previously arranged and flowing from right to left. Since numeric verification codes (OTP) are read and entered Left-to-Right (LTR) in all languages, this caused digits to render in reverse order (e.g.123456rendered as654321) and inverted the outer border-radius styling on slots.This PR fixes the issue by enforcing
[direction:ltr]on the container element anddir="ltr"onOTPInput.Affected Components
InputOTPInputOTPGroupInputOTPSlotChanges Made
[direction:ltr]tocontainerClassNameinInputOTPacross all component registry styles (new-york-v4,bases/radix, andbases/base).dir="ltr"toOTPInputto guarantee LTR directionality for the input element and all descendant slot elements (InputOTPGroupandInputOTPSlot).How to Test
InputOTPinside an RTL container (<div dir="rtl">).Resolves #11201