Copy link to clipboard
Copied
Hey!
Does anybody have an idea if there is a safer way to use addEventListener to simulate a button functionality on hover and press?
Using this method makes my script mroe likely to crach if a modal dialog pops up (like the Auto-Save one), as well as when a modal dialog is already open and the user hovers above the panel, which triggers the event (even though the script panel is supposedly inactive).
It's painful because it makes the panel freeze without notice, then you need to relaunch it to get the error, then relaunch it again to actually relaunch the script.
I am trying to create a custom button that highlights on hover. There is nothing wrong with this method until this happens.
Does anyone have an idea of what I should do instead?
Thankya!
Have something to add?