ProjectVisBug icon indicating copy to clipboard operation
ProjectVisBug copied to clipboard

Disable interaction while editing text on interactives?

Open hchiam opened this issue 3 years ago • 3 comments

e.g. when you try to edit the text on a button, don't trigger the click event (i.e., disable event listeners?)

https://stackoverflow.com/a/17167316

hchiam avatar Nov 26 '21 22:11 hchiam

oh interesting! i usually use the keyboard to navigate to it, but it'd be much nicer to have the ability to suspend events on elements just in time. this would be very cool to combine with a hotkey, so you could hover things and access their children, but explicitly prevent firing events on interaction when needed. very cool!

argyleink avatar Nov 30 '21 22:11 argyleink

Actually, this bug might be a thing specific to a project I'm working on*

i tested editing text a little more thoroughly. here's some test cases:

tried editing text: doesn't trigger event listener?
<a> without click event ✅ doesn't trigger
<a> with click event ✅ doesn't trigger
<button> without click event ✅ doesn't trigger
<button> with click event ✅ doesn't trigger
*<a> with mouseup event ❌ triggers event

hchiam avatar Dec 01 '21 22:12 hchiam

that's quite the wiggly scenario! i wonder if it's a bug in preventDefault() or stopPropagation()?

argyleink avatar Dec 02 '21 18:12 argyleink