Default to ltr for reading direction (#18767)

This commit is contained in:
Matthias Alphart
2023-11-29 10:17:31 +01:00
committed by GitHub
parent 44157a5df3
commit 7356db919a
10 changed files with 20 additions and 10 deletions

View File

@@ -3,6 +3,7 @@ import "@material/mwc-menu";
import type { Corner, Menu, MenuCorner } from "@material/mwc-menu";
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
import { customElement, property, query } from "lit/decorators";
import { mainWindow } from "../common/dom/get_main_window";
import { FOCUS_TARGET } from "../dialogs/make-dialog-manager";
import type { HaIconButton } from "./ha-icon-button";
@@ -68,7 +69,7 @@ export class HaButtonMenu extends LitElement {
protected firstUpdated(changedProps): void {
super.firstUpdated(changedProps);
if (document.dir === "rtl") {
if (mainWindow.document.dir === "rtl") {
this.updateComplete.then(() => {
this.querySelectorAll("mwc-list-item").forEach((item) => {
const style = document.createElement("style");