Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onWillClose event for panels #854

Open
mgray88 opened this issue Feb 7, 2025 · 0 comments
Open

onWillClose event for panels #854

mgray88 opened this issue Feb 7, 2025 · 0 comments

Comments

@mgray88
Copy link

mgray88 commented Feb 7, 2025

Is your feature request related to a problem? Please describe.
I would like to be able to detect when a panel is being closed so I can either prevent it or save state.

Describe the solution you'd like
An onWillClose event handler passed in to component props alongside onDidActiveChange and others.

Describe alternatives you've considered
Tried to use closeActionOverride in a tab renderer and dispatching an event to the tab. The closest I could get was the following, which doesn't dispatch to the dom element pertaining to the rendered component:

props.containerApi
  .getPanel(id)
  ?.view.content.element.dispatchEvent(new FocusEvent('focus'))

eta: I have defaultRenderer set to always so the dom elements are outside of the scope of the event above.

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

No branches or pull requests

1 participant