mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-24 16:58:47 +01:00
Prevent propagation from nested links
This commit is contained in:
parent
671c68b8f8
commit
f5184bd608
1 changed files with 4 additions and 0 deletions
|
@ -39,6 +39,10 @@ const Link = forwardRef((props, ref) => {
|
|||
{...restProps}
|
||||
class={`${props.class || ''} ${isActive ? 'is-active' : ''}`}
|
||||
onClick={(e) => {
|
||||
if (e.currentTarget?.parentNode?.closest('a')) {
|
||||
// If this <a> is nested inside another <a>
|
||||
e.stopPropagation();
|
||||
}
|
||||
if (routerLocation) states.prevLocation = routerLocation;
|
||||
props.onClick?.(e);
|
||||
}}
|
||||
|
|
Loading…
Reference in a new issue