From abf95a4e9a5f4000ead38230d2faabd138b6a414 Mon Sep 17 00:00:00 2001 From: John Factotum <50942278+johnfactotum@users.noreply.github.com> Date: Sun, 23 Apr 2023 14:00:17 +0800 Subject: [PATCH] Fix text direction info The spec changed and has been implemented in WebKit: https://bugs.webkit.org/show_bug.cgi?id=252444 But not in Chromium yet: https://crbug.com/v8/13835 --- view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view.js b/view.js index f2d063f..da687a2 100644 --- a/view.js +++ b/view.js @@ -45,7 +45,7 @@ export class View { const tag = typeof language === 'string' ? language : language[0] const locale = new Intl.Locale(tag) this.isCJK = ['zh', 'ja', 'kr'].includes(locale.language) - this.textDirection = locale.textInfo.direction + this.textDirection = (locale.getTextInfo?.() ?? locale.textInfo)?.direction } catch(e) { console.warn(e) }