Closed bttf closed 1 year ago
I wasn't able to select most of the elements to edit. Clicking on them just immediately navigated to the href of the link instead of selecting it in the editor. [https://spanx.com/](https://spanx.com/) For example, I couldn't select the H1 in the below screenshot. [image.png](https://uploads.linear.app/6d77a64e-b8c4-40e5-8535-390042384f91/1ce0bc2b-ea6c-4146-a61c-4eeae6bfc2cd/12427ade-19bb-45d3-bfee-ad8d4044808f)
Issues:
Reasons:
mousedown
event was not firing - which is very strange. Even for event handlers that were registered at the capture phase onmousedown
, they would not get fired.getEventListeners
on thedocument
object, there seemed to be apointerdown
event that was registered also at the capture phaseevent.preventDefault
) at thepointerdown
event when captured, it will completely blockmouseup
/mousedown
from firingclick
are not blocked and fire expectedlyclick
event handler defined that would callpreventDefault
andstopPropagation
preventDefault
would 'cancel' the eventpreventDefault
would not stop custom event handlers from processing the click. Furthermore, stopPropogation at the top of the tree might be 'too late' since the custom event handler would likely be below the document object in the DOM tree (and fired earlier)Fixes:
pointerup
/pointerdown
click
event handler is in capture phase and both cancels event and stops propagation