Skip to content

Commit

Permalink
fix tooltip to sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
haitrr committed Jan 1, 2022
1 parent 9fbe413 commit 37826a1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Components/Term/TermTooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,22 @@ const TermTooltip: React.FC<Props> = ({ term, bookmark, onClick, onHover, index
const handleMouseEnter = (event: any) => {
clearTimeout(hideTimout.current);
clearTimeout(leavePopoverTimout.current);
setAnchorEl(event.currentTarget);
if (term && !dictionaried && term.meaning === '') {
// eslint-disable-next-line react/no-did-update-set-state
dictionaryTimeout.current = setTimeout(() => {
handleDictionaryTerm();
}, 100);
}
hoverTimeout.current = setTimeout(onHover, 100);
hoverTimeout.current = setTimeout(() => {
setAnchorEl(event.target);
onHover();
}, 200);
};

const handleMouseLeave = () => {
hideTimout.current = setTimeout(() => {
setAnchorEl(null);
}, 100);
}, 300);
clearTimeout(hoverTimeout.current);
clearTimeout(dictionaryTimeout.current);
};
Expand Down

1 comment on commit 37826a1

@vercel
Copy link

@vercel vercel bot commented on 37826a1 Jan 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.