From 79dcfc84befcb5394fb861e1a1e3390e3bf4517c Mon Sep 17 00:00:00 2001 From: abdo Date: Sun, 7 Mar 2021 18:12:42 +0300 Subject: [PATCH] Fix editor RTL check --- ts/editor/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ts/editor/index.ts b/ts/editor/index.ts index 5861b3da4..8e178d3fa 100644 --- a/ts/editor/index.ts +++ b/ts/editor/index.ts @@ -189,7 +189,9 @@ export class EditingArea extends HTMLDivElement { } 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 {