Skip to content

Commit

Permalink
fix(core): fix the RegExp of judging the old version of chrome #WIK-6162
Browse files Browse the repository at this point in the history
  • Loading branch information
huanhuanwa authored and pubuzhixing8 committed Mar 31, 2022
1 parent 1a524c1 commit 9d00976
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/odd-fishes-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"slate-angular": patch
---

[utils]: Fix the RegExp of judging the old version of chrome
6 changes: 4 additions & 2 deletions packages/src/utils/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ export const IS_CHROME =

// Native beforeInput events don't work well with react on Chrome 75 and older, Chrome 76+ can use beforeInput
export const IS_CHROME_LEGACY =
typeof navigator !== 'undefined' &&
/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])/i.test(navigator.userAgent);
typeof navigator !== 'undefined' &&
/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])/i.test(navigator.userAgent) &&
// Exclude Chrome version greater than 3 bits,Chrome releases v100 on 2022.03.30
!/Chrome?\/(?:\d{3,})/i.test(navigator.userAgent);


// Firefox did not support `beforeInput` until `v87`.
Expand Down

0 comments on commit 9d00976

Please sign in to comment.