(false);
const onLongHover = React.useCallback(
@@ -308,14 +310,14 @@ export class FormattingMenu {
setHasLongHovered(false)}
>
boolean | undefined;
+ isActive: boolean | undefined;
label: string;
onLongHover: (value: boolean) => unknown;
popupGuideText: string;
@@ -413,6 +421,15 @@ function FormattingButton({
const timerRef = React.useRef();
const [isHovered, setIsHovered] = React.useState(false);
+ React.useEffect(() => {
+ return () => {
+ if (timerRef.current) {
+ clearTimeout(timerRef.current);
+ timerRef.current = undefined;
+ }
+ };
+ }, []);
+
return (
<>
{hasLongHovered && isHovered && buttonRef.current ? (
@@ -434,7 +451,12 @@ function FormattingButton({