mirror of
https://github.com/xitanggg/open-resume
synced 2024-11-03 09:19:21 +01:00
Extend BulletListTextareaFallback to Safari
This commit is contained in:
parent
c40f2e50a1
commit
fc5325f8ae
@ -1,3 +1,4 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import ContentEditable from "react-contenteditable";
|
||||
import { useAutosizeTextareaHeight } from "lib/hooks/useAutosizeTextareaHeight";
|
||||
|
||||
@ -83,7 +84,19 @@ export const Textarea = <T extends string>({
|
||||
export const BulletListTextarea = <T extends string>(
|
||||
props: InputProps<T, string[]> & { showBulletPoints?: boolean }
|
||||
) => {
|
||||
if (navigator.userAgent.includes("Firefox")) {
|
||||
const [showFallback, setShowFallback] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const isFirefox = navigator.userAgent.includes("Firefox");
|
||||
const isSafari =
|
||||
navigator.userAgent.includes("Safari") &&
|
||||
!navigator.userAgent.includes("Chrome"); // Note that Chrome also includes Safari in its userAgent
|
||||
if (isFirefox || isSafari) {
|
||||
setShowFallback(true);
|
||||
}
|
||||
}, []);
|
||||
|
||||
if (showFallback) {
|
||||
return <BulletListTextareaFallback {...props} />;
|
||||
}
|
||||
return <BulletListTextareaGeneral {...props} />;
|
||||
|
Loading…
Reference in New Issue
Block a user