feat(NavigationMenu): handle children on vertical orientation (#2384)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Sandro Circi
2024-10-22 22:52:38 +02:00
committed by GitHub
parent 69d7b57825
commit 34bddd45be
22 changed files with 277 additions and 154 deletions

View File

@@ -3,7 +3,7 @@ export interface LinkBaseProps {
as?: string
type?: string
disabled?: boolean
onClick?: (e: MouseEvent) => void | Promise<void>
onClick?: ((e: MouseEvent) => void | Promise<void>) | Array<((e: MouseEvent) => void | Promise<void>)>
href?: string
navigate?: (e: MouseEvent) => void
rel?: string
@@ -28,7 +28,9 @@ function onClickWrapper(e: MouseEvent) {
}
if (props.onClick) {
props.onClick(e)
for (const onClick of Array.isArray(props.onClick) ? props.onClick : [props.onClick]) {
onClick(e)
}
}
if (props.href && props.navigate && !props.isExternal) {