feat(nvim-tree): incorrect double click detection

This commit is contained in:
Pihkaal
2024-09-13 14:30:47 +02:00
parent 7b9c438f02
commit d1ffa224a0

View File

@@ -16,21 +16,17 @@ export const NvimTreeChild = (props: {
const handleClick = () => {
props.onSelect(props.y);
if (lastClick) {
if (Date.now() - lastClick <= 500) {
if (lastClick && Date.now() - lastClick <= 500) {
props.onOpen(props.child);
}
setLastClick(undefined);
} else {
setLastClick(Date.now());
}
};
return (
<li
style={{ background: props.selected ? "#504651" : "" }}
onMouseDown={handleClick}
onClick={handleClick}
>
{" "}
{props.inDirectory && (