Skip to content

[lexical-playground] Bug Fix: restore RTL checkbox position in checklist#8783

Merged
etrepum merged 1 commit into
facebook:mainfrom
ryanda9910:fix/checklist-rtl-checkbox-position
Jul 4, 2026
Merged

[lexical-playground] Bug Fix: restore RTL checkbox position in checklist#8783
etrepum merged 1 commit into
facebook:mainfrom
ryanda9910:fix/checklist-rtl-checkbox-position

Conversation

@ryanda9910

Copy link
Copy Markdown
Contributor

Description

In RTL, the checklist checkbox renders on the wrong (left) side. v0.35.0 was 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:

.PlaygroundEditorTheme__listItemUnchecked[dir='rtl']:before,
.PlaygroundEditorTheme__listItemChecked[dir='rtl']:before {
  left: auto;
  right: 0;
}

Since then the :before box and :after checkmark stay pinned to left, so the marker sits on the left in RTL.

Notably, the click hit-test in packages/lexical-list/src/checkList.ts already handles RTL correctly (it targets rect.right when target.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 --check clean on the touched file.
  • Visual verification of the em-based marker in RTL vs LTR (below). CSS positioning is not unit-testable; the checklist marker is not covered by the playground e2e in a way that asserts pixel side, so the device/e2e render is deferred to CI.

Before

RTL checkbox renders on the left (wrong).

After

RTL checkbox renders on the right (correct); LTR unchanged.

before-after

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
@vercel

vercel Bot commented Jul 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview Jul 4, 2026 7:33am
lexical-playground Ready Ready Preview Jul 4, 2026 7:33am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 4, 2026
@ryanda9910 ryanda9910 marked this pull request as ready for review July 4, 2026 07:34
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label Jul 4, 2026
@etrepum etrepum added this pull request to the merge queue Jul 4, 2026
Merged via the queue into facebook:main with commit afa43a7 Jul 4, 2026
13 checks passed
@etrepum etrepum mentioned this pull request Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Version 0.35.0 broke CheckList in RTL

2 participants