totaljs / openplatform

OpenPlatform v5 is a beautiful and simple portal for running, integrating and managing multiple 3rd party web applications.
https://www.totaljs.com/openplatform/
MIT License
95 stars 45 forks source link

add event listener to ESC key to close windows #58

Closed landsman closed 10 months ago

landsman commented 10 months ago

It's frustrating that I can not close windows by pressing the ESC key. Please add an event listener for that. 🙏

landsman commented 10 months ago

btw here is great standard which you can probably use, to make it work out of the box: https://blog.webdevsimplified.com/2023-04/html-dialog/

petersirka commented 10 months ago

It depends on which modal forms because if you fill a form and press the ESC key accidentally, your data will be lost. Therefore we disabled this functionality.

landsman commented 10 months ago

It depends on which modal forms because if you fill a form and press the ESC key accidentally, your data will be lost. Therefore we disabled this functionality.

Okay, I understand. Anyway, you can do confirm() dialog if data was modified and not saved yet. Or save them to localStorage, for easy recovery, as many platforms do.

petersirka commented 10 months ago

Yes, but it's not easy to implement it thoroughly. We will add notes about it to our to-do list for future implementation. Try to find a smart solution for all forms and make a pull request if you need it ASAP. We will consider approving.