Skip to content

fix(RtlService): read computed direction, so an LTR island on an RTL page is LTR - #289

Merged
xidedix merged 3 commits into
v5.7from
fix/rtl-service-island
Oct 9, 2026
Merged

xidedix merged 3 commits into
v5.7from
fix/rtl-service-island

Conversation

@xidedix

@xidedix xidedix commented Oct 9, 2026

Copy link
Copy Markdown
Member

RtlService.isRTL(element) returned true for every element under a dir="rtl" ancestor, so a component inside a dir="ltr" island on an RTL page mirrored its arrow keys and slider clicks. It now reads the element's computed direction, so a dir="ltr" island and direction: ltr from CSS are LTR. Without a computed direction (detached element, SSR) the nearest dir="ltr" or dir="rtl" ancestor decides, dir="auto" skipped, then the document. No :dir(), which Chrome and Edge 119 lack.

Changed answers for direct callers: tel, url, email and number fields, which the reboot keeps LTR, are LTR on an RTL page; a detached element with no dir="ltr" or dir="rtl" ancestor gets the dir of <html> or <body> instead of false.

Specs for the service and for chip set in an island. Docs examples on a pro build, LTR island on an RTL page: tabs, rating, OTP and stepper arrows, range slider clicks and labels match the LTR page; a fully RTL page is unchanged.

…n RTL page is LTR

Any dir="rtl" ancestor won over the element's own direction. Computed direction decides now;
nearest [dir] only without one (detached element; SSR, Domino returns inline style only).
Callers: tabs-list, chip-set; pro adds rating, OTP, stepper, range-slider, autocomplete.
:dir() missing in Chrome/Edge 119, inside Angular 22 browser floor. Without computed direction
(detached, SSR) dir="auto" cannot be resolved, so it is skipped for the next explicit dir.
@xidedix
xidedix merged commit fa380bd into v5.7 Oct 9, 2026
11 of 12 checks passed
@xidedix
xidedix deleted the fix/rtl-service-island branch October 9, 2026 23:02
xidedix added a commit that referenced this pull request Oct 10, 2026
- feat(chip): add `c-chip` and `c-chip-set` (#288)
- feat(chip-input): add `c-chip-input` (#290)
- fix(theme.directive): `colorScheme="light"` kept on first render (#287)
- fix(rtl.service): read the computed direction, so an LTR island on an RTL page is LTR (#289)
- chore(dependencies): update to Angular 22.2.2, `@types/node` to 26.6.5

Verified: `npm ci`, lint, tests 60 + 781 + 30, 3 prod builds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant