[lexical-playground] Bug Fix: restore RTL checkbox position in checklist#8783
Merged
etrepum merged 1 commit intoJul 4, 2026
Merged
Conversation
The checklist marker's `[dir='rtl']` positioning overrides were dropped in facebook#7558 when the checkbox styles were reworked to em-based units. Without them the `:before` box and `:after` checkmark stay pinned to the left edge in RTL, so the checkbox renders on the wrong side. The click hit-test in `checkList.ts` already targets the right edge when `dir === 'rtl'`, so the marker was visually on the left while the clickable area was on the right. Re-add the RTL overrides (mirrored to the right) so the rendered marker and the hit area agree again. Fixes facebook#7929
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
approved these changes
Jul 4, 2026
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 RTL, the checklist checkbox renders on the wrong (left) side.
v0.35.0was reported as the cause, but tracing the CSS history shows the actual regression came from #7558, which reworked the checkbox marker to em-based units and, in the process, dropped the two[dir='rtl']positioning overrides that used to mirror the marker to the right:Since then the
:beforebox and:aftercheckmark stay pinned toleft, so the marker sits on the left in RTL.Notably, the click hit-test in
packages/lexical-list/src/checkList.tsalready handles RTL correctly (it targetsrect.rightwhentarget.dir === 'rtl'). So the marker was drawn on the left while the clickable area was on the right, i.e. the toggle target and the visible checkbox disagreed. Re-adding the RTL CSS overrides (mirrored to the right in the new em-based scheme) fixes the visual position and realigns it with the existing hit-test.This is a minimal, CSS-only change scoped to the playground theme. The reporter also mentioned that the click logic expected left-side clicks, but that is no longer the case on
main(RTL detection was added in #7429), so no plugin change is needed.Closes #7929
Test plan
pnpm vitest --project unit --no-watch packages/lexical-list/src/__tests__/unit/checkList.test.tsx-> 4/4 pass (no regression).prettier --checkclean on the touched file.Before
RTL checkbox renders on the left (wrong).
After
RTL checkbox renders on the right (correct); LTR unchanged.