Skip to content

Commit

Permalink
fix: regular expression for testing Webkit based browser (#5453)
Browse files Browse the repository at this point in the history
* fix: IS_WEBKIT environment symbol excluding blink based browser

* chore: add changeset

* fix: prettier

---------

Co-authored-by: zhanglixin08 <zhanglixin08@meituan.com>
  • Loading branch information
Shiba-ligo and zhanglixin08 committed Jun 16, 2023
1 parent b01f931 commit cde0a15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/khaki-toys-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-react': patch
---

fix regular expression for testing Webkit based browser.
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 @@ -20,7 +20,8 @@ export const IS_FIREFOX =
/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent)

export const IS_WEBKIT =
typeof navigator !== 'undefined' && /AppleWebKit/.test(navigator.userAgent)
typeof navigator !== 'undefined' &&
/AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent)

// "modern" Edge was released at 79.x
export const IS_EDGE_LEGACY =
Expand Down

0 comments on commit cde0a15

Please sign in to comment.