Skip to content

Commit ec5adeb

Browse files
committed
fix: remove navigator check
1 parent 17f822c commit ec5adeb

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

lib/utils.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33
*/
44
export const applyStyles = (element: HTMLDivElement, styles: React.CSSProperties) => {
55
for (const [style, value] of Object.entries(styles)) {
6-
if (isSafariDesktop()) {
7-
element.style[style] = value
8-
} else {
9-
requestAnimationFrame(() => {
10-
element.style[style] = value
11-
})
12-
}
6+
element.style[style] = value
137
}
148
}
159

@@ -27,12 +21,3 @@ export const clamp = (value: number, min: number, max: number) => {
2721
*/
2822
// eslint-disable-next-line @typescript-eslint/ban-types
2923
export const isFunction = (value: unknown): value is Function => typeof value === "function"
30-
31-
/**
32-
* Detect whether the current browser is a desktop version of Safari.
33-
*/
34-
export const isSafariDesktop = () => {
35-
const { userAgent, vendor } = navigator
36-
37-
return /Safari/i.test(userAgent) && /Apple Computer/.test(vendor) && !/Mobi|Android/i.test(userAgent)
38-
}

0 commit comments

Comments
 (0)