fix(toggle): rtl layout renders correctly in safari (#26315)

This commit is contained in:
Liam DeBeasi
2022-11-21 11:33:11 -05:00
committed by GitHub
parent e14c94722c
commit 0932f89f5d
35 changed files with 66 additions and 53 deletions

View File

@ -210,6 +210,7 @@ export class Toggle implements ComponentInterface {
const mode = getIonMode(this);
const { label, labelId, labelText } = getAriaLabel(el, inputId);
const value = this.getValue();
const rtl = isRTL(el) ? 'rtl' : 'ltr';
renderHiddenInput(true, el, name, checked ? value : '', disabled);
@ -227,6 +228,7 @@ export class Toggle implements ComponentInterface {
'toggle-checked': checked,
'toggle-disabled': disabled,
interactive: true,
[`toggle-${rtl}`]: true,
})}
>
<div class="toggle-icon" part="track">