Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More resilient directionality checks #2189

Open
wants to merge 3 commits into
base: next
Choose a base branch
from
Open

Conversation

claviska
Copy link
Member

fixes #2188

Copy link

vercel bot commented Sep 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
shoelace ✅ Ready (Inspect) Visit Preview Oct 4, 2024 8:27pm

@fbecker-complex
Copy link
Contributor

Thanks for the quick fix!

@clxmstaab
Copy link

we can confirm the fix is working for us.

@@ -259,7 +259,7 @@ export class SubmenuController implements ReactiveController {
}

renderSubmenu() {
const isRtl = this.host.matches(':dir(rtl)');
const isRtl = getComputedStyle(this.host).direction === 'rtl';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason these don't do this.host.localize.dir() ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The localize property is private and this only occurs once when the submenu shows, so a reflow won't be problematic. We could consider exposing this.localize as public properties, but I didn't want to commit to that without a discussion first.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷 fine with me

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.

RTL- / LTR-detection leads to hard errors in older browsers
4 participants