onDispose is called for Command Set and Application customizers at lease when event similar to page navigation are appeared.
onDispose has never been called
@override
public onDispose() {
alert('on Dispose');
}
gulp serveThank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
So the app customizer should only get disposed when the host app is disposed. Hopefully not on a page to page navigate. Any chance you can check to see if this is targeted release only?
@patmill - any type of tenant.
I don't see these events fired on Standard and Targeted Release tenants.
Maybe for app customizer it's a valid statement. But what about Command Set?
I would expect that they are called, yes.
BTW, same with Field Customizer. onDisposeCell is called, which is good. But onDispose that is for the whole Customizer - not.
onDispose does work with ApplicationCustomizers. I was able to get it to work when I did an in-place navigation between sites from a modern page that has an ApplicationCustomizers to one that doesn't have an ApplicationCustomizer. Since disposeExtension gets hit and onDispose gets reached (onDispose comes from BaseComponent), I think the issue is that the logic to when a certain extension gets disposed isn't documented and not intuitive (if it is please provide a link).
This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within the next 7 days of this comment. Please see our wiki for more information: Issue List Labels: Needs Author Feedback & Issue List: No response from the original issue author
We need documentation for sure... I'm still confused about when it's called when it's not.
Especially because not many devs know that "Page" and "List" are 2 different SPAs inside SharePoint.