diff --git a/.changeset/cuddly-foxes-sell.md b/.changeset/cuddly-foxes-sell.md new file mode 100644 index 000000000..db99752dc --- /dev/null +++ b/.changeset/cuddly-foxes-sell.md @@ -0,0 +1,5 @@ +--- +'slate-react': minor +--- + +Fix chrome and edge three digit version check diff --git a/packages/slate-react/src/utils/environment.ts b/packages/slate-react/src/utils/environment.ts index f059fce3b..7f78f135b 100644 --- a/packages/slate-react/src/utils/environment.ts +++ b/packages/slate-react/src/utils/environment.ts @@ -21,7 +21,7 @@ export const IS_SAFARI = // "modern" Edge was released at 79.x export const IS_EDGE_LEGACY = typeof navigator !== 'undefined' && - /Edge?\/(?:[0-6][0-9]|[0-7][0-8])/i.test(navigator.userAgent) + /Edge?\/(?:[0-6][0-9]|[0-7][0-8])(\.)/i.test(navigator.userAgent) export const IS_CHROME = typeof navigator !== 'undefined' && /Chrome/i.test(navigator.userAgent) @@ -30,7 +30,7 @@ export const IS_CHROME = // and older, Chrome 76+ can use `beforeInput` though. export const IS_CHROME_LEGACY = typeof navigator !== 'undefined' && - /Chrome?\/(?:[0-7][0-5]|[0-6][0-9])/i.test(navigator.userAgent) + /Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(\.)/i.test(navigator.userAgent) // Firefox did not support `beforeInput` until `v87`. export const IS_FIREFOX_LEGACY =