Link-Klick ignoriert event.preventDefault() — Navigation trotz Cancel #29
Labels
No labels
bug
docs
feature
housekeeping
html-spec
performance
react-compat
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
glow-all/true-headless-browser#29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Clicking an
<a href="...">link always triggers navigation viapage.goto(), even if the click event was cancelled withevent.preventDefault().In a real browser,
event.preventDefault()on a click event suppresses the default action (navigation). Our engine dispatches the events but never checks the return value ofdispatchEvent().Current Behavior
Expected Behavior
Location
src/pages/page.ts, method_dispatchClick()(line ~570)clickevent's default was preventedel.dispatchEvent(event)returnsfalseifpreventDefault()was called on a cancelable eventProposed Fix
In
_dispatchClick(), capture the return value ofthis.dispatcher.dispatchClick()and only call_navigateLink()if the event was not cancelled:Test
Siehe
tests/interaction/link-navigation.test.ts— Test 4 dokumentiert das aktuelle defekte Verhalten. Nach dem Fix muss dort umgedreht werden.Link-Klick ignoriert event.preventDefault() — Navigation trotz Cancel. ✅ Gefixt in link-navigation.test.ts: EH4, EH18 testen preventDefault. Commit
50900eb.