Skip to content
This repository has been archived by the owner on Sep 7, 2018. It is now read-only.

Add ability to prevent window closing #183

Open
BenLambertNcl opened this issue Jun 7, 2017 · 0 comments
Open

Add ability to prevent window closing #183

BenLambertNcl opened this issue Jun 7, 2017 · 0 comments

Comments

@BenLambertNcl
Copy link
Collaborator

In OpenFin, listening to close-requested disables the closing of the window. @jleft suggested this approach instead:

I'd propose that the behaviour by default would be that the window will close, regardless of whether the close listener is added or not (in OpenFin the close would be forced). However, add the option for the user to prevent the default behaviour (i.e. prevent the close using event.preventDefault()) within their event handler. Our API can then detect if default has been prevented (i.e. event.defaultPrevented) and use this to determine whether this window should be closed or not (in Openfin, force close if event.defaultPrevented === false, otherwise don't close). What do you think?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant