Closed njarraud closed 2 months ago
In the following example, clicking on the button element will not trigger the progress bar as expected but clicking on any children that may be inside e.g. LuPlusCircle will.
button
LuPlusCircle
type Props = { label: string }; const Organisations = ({ label }: Props) => { const handleClick = (e: MouseEvent<HTMLButtonElement>) => { e.stopPropagation(); e.preventDefault(); }; return ( <Link href=""> <div className="grow">{label}</div> <button className="h-4.5 w-4.5" onClick={handleClick} data-prevent-nprogress={true}> <LuPlusCircle size="100%" /> </button> </Link> ); };
I believe you shall also check the ancestors of the target here -
const preventProgress = target?.getAttribute('data-prevent-nprogress') === 'true' || anchorElement?.getAttribute('data-prevent-nprogress') === 'true';
Also experiencing this issue - on latest release 2.3.11
experiencing this
In the following example, clicking on the
button
element will not trigger the progress bar as expected but clicking on any children that may be inside e.g.LuPlusCircle
will.I believe you shall also check the ancestors of the target here -