Skip to content

Commit

Permalink
bugfix: avoid lookbehind (#5503)
Browse files Browse the repository at this point in the history
  • Loading branch information
janpaepke committed Aug 29, 2023
1 parent f8d8d01 commit e308cd6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/quick-eyes-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-react': patch
---

bugfix: slate breaks on load on safari < 16.4
3 changes: 2 additions & 1 deletion packages/slate-react/src/utils/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export const IS_UC_MOBILE =
// Wechat browser (not including mac wechat)
export const IS_WECHATBROWSER =
typeof navigator !== 'undefined' &&
/.*(?<!Mac)Wechat/.test(navigator.userAgent)
/.*Wechat/.test(navigator.userAgent) &&
!/.*MacWechat/.test(navigator.userAgent) // avoid lookbehind (buggy in safari < 16.4)

// 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 e308cd6

Please sign in to comment.