fix(VB-1797): match caret direction to text when inline editing#620
Open
karancs06 wants to merge 1 commit into
Open
fix(VB-1797): match caret direction to text when inline editing#620karancs06 wants to merge 1 commit into
karancs06 wants to merge 1 commit into
Conversation
Inline-editable fields kept an LTR caret even when the content was right-to-left, so the caret ignored where RTL text (Arabic, Hebrew) was being inserted. Set dir="auto" on the editable element so the browser derives writing direction from the content, and clear it on teardown. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
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.
What
Inline-editable text fields kept a left-to-right caret even when the field held right-to-left content (Arabic, Hebrew). The glyphs rendered in the correct RTL order, but the caret stayed on the LTR side and did not follow where characters were being inserted, so editing RTL text was awkward.
Change
dir="auto"on the editable element when inline editing turns on. The browser then picks the writing direction from the content's first strong character, so the caret matches the text.contenteditablecleanup, so nothing is left on the host element.Notes
Testing
npx vitest runfor the affected utils passes.Jira: VB-1797