Menu: fix #47, skip animateOpen if animating
This commit is contained in:
parent
a69a5c31e5
commit
9a7710c070
3 changed files with 124 additions and 73 deletions
|
@ -7,11 +7,7 @@ import {
|
|||
ListItemText,
|
||||
MenuItem,
|
||||
} from "@suid/material";
|
||||
import {
|
||||
Show,
|
||||
createUniqueId,
|
||||
type ParentComponent,
|
||||
} from "solid-js";
|
||||
import { Show, createUniqueId, type ParentComponent } from "solid-js";
|
||||
import {
|
||||
Settings as SettingsIcon,
|
||||
Bookmark as BookmarkIcon,
|
||||
|
@ -39,9 +35,7 @@ const ProfileMenuButton: ParentComponent<{
|
|||
|
||||
const [open, state] = createManagedMenuState();
|
||||
|
||||
const onClick = (
|
||||
event: MouseEvent & { currentTarget: HTMLButtonElement },
|
||||
) => {
|
||||
const onClick = (event: { currentTarget: HTMLElement }) => {
|
||||
open(event.currentTarget.getBoundingClientRect());
|
||||
};
|
||||
|
||||
|
@ -54,8 +48,8 @@ const ProfileMenuButton: ParentComponent<{
|
|||
sx={{ borderRadius: "50%" }}
|
||||
id={buttonId}
|
||||
onClick={onClick}
|
||||
aria-controls={open() ? menuId : undefined}
|
||||
aria-expanded={open() ? "true" : undefined}
|
||||
aria-controls={state.open ? menuId : undefined}
|
||||
aria-expanded={state.open ? "true" : "false"}
|
||||
>
|
||||
<Avatar
|
||||
alt={`${inf()?.displayName}'s avatar`}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue