Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Prevent opening of panel if panelbeforeopen callback calls preventDefault() #7414

Open
jtara opened this issue May 20, 2014 · 2 comments
Open

Comments

@jtara
Copy link

jtara commented May 20, 2014

It would be useful to be able to prevent panels from opening by calling preventDefault() from a panelbeforeopen callback.

@gabrielschulhof
Copy link

That's not a bad idea, however, there's a bit of a problem: panelbeforeopen is used by an open panel to decide to close in order to make way for a panel that is about to open. If we allow the default to be prevented, the old panel will receive the signal before the third-party code has had a chance to prevent default - unless the third-party code attaches a handler below the document level, which is where the panel's handler is attached.

@gabrielschulhof
Copy link

I guess it's not a "problem" per se, but something to keep in mind when writing the preventable panelbeforeopen event.

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