diff --git a/src/components/campaign/dashboard/CampaignHomeActionStrip.tsx b/src/components/campaign/dashboard/CampaignHomeActionStrip.tsx index 73a703a3..59c467b3 100644 --- a/src/components/campaign/dashboard/CampaignHomeActionStrip.tsx +++ b/src/components/campaign/dashboard/CampaignHomeActionStrip.tsx @@ -74,9 +74,6 @@ export const CampaignHomeActionStrip = ({ dragging: false, } suppressClickRef.current = false - if (typeof el.setPointerCapture === 'function') { - el.setPointerCapture(event.pointerId) - } }, [isCoarsePointer], ) @@ -94,6 +91,11 @@ export const CampaignHomeActionStrip = ({ if (Math.abs(deltaX) < HOME_ACTION_STRIP_DRAG_THRESHOLD_PX) return session.dragging = true setScrollerDragging(el, true) + // Capture only once pan is confirmed — capturing on pointerdown retargets + // pointerup to the scroller and child Links never receive the click (B67). + if (typeof el.setPointerCapture === 'function') { + el.setPointerCapture(event.pointerId) + } } el.scrollLeft = session.startScrollLeft - deltaX diff --git a/tests/unit/campaignHomeActionButton.unit.spec.tsx b/tests/unit/campaignHomeActionButton.unit.spec.tsx index 95604bff..edcc4d3c 100644 --- a/tests/unit/campaignHomeActionButton.unit.spec.tsx +++ b/tests/unit/campaignHomeActionButton.unit.spec.tsx @@ -272,4 +272,30 @@ describe('CampaignHomeActionStrip', () => { fireEvent.click(screen.getByRole('button', { name: 'Registrar' })) expect(onClick).toHaveBeenCalledTimes(1) }) + + it('allows wizard link navigation after pointerdown/up without a drag gesture', () => { + const onLinkClick = vi.fn() + const { container } = render( + , + ) + const scroller = getScroller(container) + mockScrollerOverflow(scroller) + const link = screen.getByRole('link', { name: 'Ajustar votos' }) + link.onclick = onLinkClick + + fireEvent.pointerDown(link, { button: 0, clientX: 40, pointerId: 5 }) + fireEvent.pointerUp(link, { pointerId: 5 }) + fireEvent.click(link) + + expect(onLinkClick).toHaveBeenCalledTimes(1) + }) })