Skip to content

[@mantine/nprogress] NavigationProgress: Mirror glow direction in RTL - #9452

Open
Twiink wants to merge 2 commits into
mantinedev:masterfrom
Twiink:fix/nprogress-rtl-glow
Open

Twiink wants to merge 2 commits into
mantinedev:masterfrom
Twiink:fix/nprogress-rtl-glow

Conversation

@Twiink

@Twiink Twiink commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #9450

NavigationProgress positions its glow at the leading edge in RTL, but keeps the LTR rotation. Mirror the glow rotation with the existing where-rtl mixin so its tilt follows the direction of progress. LTR styling is unchanged.

Verified the public, built component in Chrome for LTR and RTL at 60% progress. Before the change the RTL tilt assertion fails; afterward both directions pass with the same bar width and ARIA value. Also passed 158 related Progress tests, all package builds, full typecheck, full stylelint, scoped nprogress oxlint and CSS formatting.

@rtivital rtivital added the ? label Nov 23, 2026
@rtivital

rtivital commented Dec 5, 2026

Copy link
Copy Markdown
Member

The change at 875c8da986195fcc8eaf5342ba5ed6c6899c025f fixes the original RTL screenshot, but it reverses the glow on a bar that explicitly uses LTR inside an RTL page.

To reproduce in Chrome: set <html dir="rtl">, render <NavigationProgress dir="ltr" />, and call nprogress.set(60). The bar correctly fills from the left, so its glow should be brightest at the moving right tip. On the base (af8823eb), it is. On this PR, the section still computes to direction: ltr with the pseudo-element inset 1px from the right, but the tilt changes from +4deg to -4deg. The bright end moves back inside the bar. I saw the same result with the default portal and with withinPortal={false}.

The where-rtl rule matches the RTL document even when the bar overrides it. Could the rotation follow the section's own direction instead, for example by matching :dir(rtl) on the section before ::before?

Twiink commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the repro, @rtivital. I confirmed the wrong tilt on 875c8da9 with both the default portal and withinPortal={false}. The revision selects RTL on the progress section before ::before, so the glow follows the section’s own dir.

The new Storybook regression checks the LTR bar inside an RTL container. It fails on the current PR head and passes with the fix. I also checked eight direction and portal combinations in Chrome against the built packages, including both portal modes of your repro. All eight pass. Published in 07915076.

Original report

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NavigationProgress in RTL is not correct

2 participants