fix: tag context menu button opening notes list veiw (#1390)

This commit is contained in:
Aman Harwara
2022-08-10 18:13:29 +05:30
committed by GitHub
parent 83f6cc667d
commit 82a8bcc440

View File

@@ -183,7 +183,11 @@ export const TagsListItem: FunctionComponent<Props> = observer(
const readyToDrop = isOver && canDrop const readyToDrop = isOver && canDrop
const toggleContextMenu = useCallback(() => { const toggleContextMenu: MouseEventHandler<HTMLAnchorElement> = useCallback(
(event) => {
event.preventDefault()
event.stopPropagation()
if (!menuButtonRef.current) { if (!menuButtonRef.current) {
return return
} }
@@ -196,7 +200,9 @@ export const TagsListItem: FunctionComponent<Props> = observer(
} else { } else {
onContextMenu(tag, menuButtonRect.right, menuButtonRect.top) onContextMenu(tag, menuButtonRect.right, menuButtonRect.top)
} }
}, [onContextMenu, tagsState, tag]) },
[onContextMenu, tagsState, tag],
)
return ( return (
<> <>