Open cotton123236 opened 1 year ago
You can create a interval of, like 5 milliseconds and check for the ninja.__visible variable
In case someone needs a way to detect a ninja visible modal:
ninjaModal = document.querySelector('ninja-keys')
if (ninjaModal) {
const el = ninjaModal.shadowRoot.querySelector('div')
if (el && el.classList.contains('visible')) {
return
}
}
Great library! It makes building cmd tools super easy! I recently got a situation when I use
ninja-keys
to work with my react project. I use global storage to store the state ofninja-keys
, but I don't know when should I set the state to false and I couldn't find any eventListener to check modal is open ore close. If there is any way to listen modal state will be great!