--- id: 36d37754-80e8-4efa-a43f-48ade3f0fb40 type: solution title: "Foundry VTT ApplicationV2 Tab Switching Fix" tags: [foundry, vtt, applicationv2, tabs, fix, vagabond] importance: 0.8 confidence: 0.8 created: "2025-12-14T22:11:36.545208+00:00" updated: "2025-12-14T22:11:36.545208+00:00" --- When using ApplicationV2 parts-based rendering for tabs, switching tabs causes content to stack instead of replace. ApplicationV2 appends new parts without removing old ones from the DOM. Solution: Add _cleanupInactiveTabs() method in _onRender that removes .tab-content elements that don't match the active tab class. Each tab template should have a unique class like main-tab, inventory-tab, etc. The cleanup method checks for elements with .tab-content class and removes those that don't have the activeTabClass.