1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-07-31 20:40:19 +02:00

fix: no composing text inserted on mac wechat browser (#5497)

* fix: no composing text inserted on mac wechat browser

* chore: add changeset

* Update packages/slate-react/src/utils/environment.ts

---------

Co-authored-by: wei lingfeng <lfwei@inftech.ai>
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
This commit is contained in:
Dimitri Wei
2023-08-26 19:23:00 +08:00
committed by GitHub
parent a25d7a40e5
commit 76ba375983
2 changed files with 8 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
'slate-react': patch
---
fix the bug that user cannot input chinese on mac wechat browser.

View File

@@ -52,9 +52,10 @@ export const IS_FIREFOX_LEGACY =
export const IS_UC_MOBILE = export const IS_UC_MOBILE =
typeof navigator !== 'undefined' && /.*UCBrowser/.test(navigator.userAgent) typeof navigator !== 'undefined' && /.*UCBrowser/.test(navigator.userAgent)
// Wechat browser // Wechat browser (not including mac wechat)
export const IS_WECHATBROWSER = export const IS_WECHATBROWSER =
typeof navigator !== 'undefined' && /.*Wechat/.test(navigator.userAgent) typeof navigator !== 'undefined' &&
/.*(?<!Mac)Wechat/.test(navigator.userAgent)
// Check if DOM is available as React does internally. // Check if DOM is available as React does internally.
// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js // https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js