Skip to content

Commit

Permalink
fix: no composing text inserted on mac wechat browser (#5497)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Dylan Schiemann <[email protected]>
  • Loading branch information
3 people authored Aug 26, 2023
1 parent a25d7a4 commit 76ba375
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/grumpy-seahorses-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-react': patch
---

fix the bug that user cannot input chinese on mac wechat browser.
5 changes: 3 additions & 2 deletions packages/slate-react/src/utils/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 76ba375

Please sign in to comment.