onDispose not getting called and webparts persisting between single app pages #8251
Closed
1 of 9 tasks
Labels
area:spfx
Category: SharePoint Framework (not extensions related)
status:fixed-next-drop
Issue planned to be fixed in an upcoming release.
type:bug-suspected
Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Milestone
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
Windows
What browser(s) / client(s) have you tested
Additional environment details
Describe the bug / error
Repo here
When navigating between two app pages the webpart does not seem to be disposed properly. This occurs only after navigation from one app page to another, and not if the webparts are contained in a "normal" modern page (with sections/columns).
In the gif below I have setup 2 app pages from the repo above (which is just out of the box from the generator + alert when rendered and alert when disposed). Each app page uses the same web part 'ondispose3' with a different description ('Instance 1', 'Instance 2').
When navigating between these using site navigation it seems
onDispose
is not being called. This leaves the render still happening even in a page like "Documents".Works: 'Documents' -> 'App Page 1' -> 'Documents' -> 'App Page 2' -> 'Documents'
Does not work: 'Documents' -> 'App Page 1' -> 'App Page 2' -> 'Documents' ('App Page 1' still seems to be trying to render)
#6246 #6786 and #5227 all seemed somewhat related but do not seem to be directly applicable/solve the issue.
Steps to reproduce
Expected behavior
Webparts in the app pages should be disposed correctly between navigation and scenarios like: 'Documents' -> 'App Page 1' -> 'App Page 2' -> 'Documents' should not cause additional renders.
The text was updated successfully, but these errors were encountered: