GoogleChromeLabs / ProjectVisBug

FireBug for designers › Edit any webpage, in any state https://a.nerdy.dev/gimme-visbug
https://visbug.web.app
Apache License 2.0
5.47k stars 287 forks source link

Disable interaction while editing text on interactives? #542

Open hchiam opened 2 years ago

hchiam commented 2 years ago

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

argyleink commented 2 years ago

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!

hchiam commented 2 years ago

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
argyleink commented 2 years ago

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