• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Use EventListeners without being prone to "Modal Dialog" crash?

Contributor ,
Mar 16, 2021 Mar 16, 2021

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!

TOPICS
Scripting

Views

87

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation