Merge pull request #1057 from abdnh/fix-editor-rtl-check

Fix editor RTL check
This commit is contained in:
Damien Elmes 2021-03-08 10:05:50 +10:00 committed by GitHub
commit 57100317e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,7 +189,9 @@ export class EditingArea extends HTMLDivElement {
} }
isRightToLeft(): boolean { isRightToLeft(): boolean {
return this.editable.style.direction === "rtl"; const styleSheet = this.baseStyle.sheet as CSSStyleSheet;
const firstRule = styleSheet.cssRules[0] as CSSStyleRule;
return firstRule.style.direction === "rtl";
} }
getSelection(): Selection { getSelection(): Selection {