fix: improve UX of dropdown (#1905)

Removed the logic of onMouseLeave. The logic of clicking to open and clicking to close is clearer.

Fixes: #1898
This commit is contained in:
Sirocco 2023-04-13 04:35:41 +08:00 committed by GitHub
parent 6d5b101bb3
commit 8f53043100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,15 +58,7 @@ export const OperationButton = ({
setPinboardMenuOpen(false);
}}
>
<div
onClick={e => {
e.stopPropagation();
}}
onMouseLeave={() => {
setOperationMenuOpen(false);
setPinboardMenuOpen(false);
}}
>
<div>
<StyledOperationButton
data-testid="pinboard-operation-button"
ref={ref => setAnchorEl(ref)}