From ea667cf0b96352e309d42375f734a28f1f2abcec Mon Sep 17 00:00:00 2001 From: Yosi Levy <37745463+yosilevy@users.noreply.github.com> Date: Tue, 21 Jun 2022 12:03:22 +0300 Subject: [PATCH] RTL safari fix (#12963) --- src/components/ha-fab.ts | 8 ++++++++ src/components/ha-textfield.ts | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/components/ha-fab.ts b/src/components/ha-fab.ts index b36871e381..2432b9a20d 100644 --- a/src/components/ha-fab.ts +++ b/src/components/ha-fab.ts @@ -19,6 +19,14 @@ export class HaFab extends FabBase { direction: var(--direction); } `, + // safari workaround - must be explicit + document.dir === "rtl" + ? css` + :host .mdc-fab--extended .mdc-fab__icon { + direction: rtl; + } + ` + : css``, ]; } diff --git a/src/components/ha-textfield.ts b/src/components/ha-textfield.ts index 6b44df8eca..32c9bbde6f 100644 --- a/src/components/ha-textfield.ts +++ b/src/components/ha-textfield.ts @@ -126,6 +126,20 @@ export class HaTextField extends TextFieldBase { direction: var(--direction); } `, + // safari workaround - must be explicit + document.dir === "rtl" + ? css` + .mdc-text-field__affix--suffix, + .mdc-text-field--with-leading-icon, + .mdc-text-field__icon--leading, + .mdc-floating-label, + .mdc-text-field--with-leading-icon.mdc-text-field--filled + .mdc-floating-label, + .mdc-text-field__input[type="number"] { + direction: rtl; + } + ` + : css``, ]; }