1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-01-17 13:38:37 +01: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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 =
typeof navigator !== 'undefined' && /.*UCBrowser/.test(navigator.userAgent)
// Wechat browser
// Wechat browser (not including mac wechat)
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.
// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js