Skip to content

Commit a9493b3

Browse files
committed
Fix: Prevent buttons from appearing during SPA navigation when floating panel is visible
1 parent 42aeb9d commit a9493b3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

buttons-init.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,19 @@ window.MaxExtensionButtonsInit = {
109109
if (window.MaxExtensionFloatingPanel) {
110110
window.MaxExtensionFloatingPanel.initialize();
111111
logConCgp('[init] Floating panel has been initialized.');
112+
113+
// Check if the floating panel should be visible after initialization
114+
// and hide the default container if needed
115+
setTimeout(() => {
116+
if (window.MaxExtensionFloatingPanel.currentPanelSettings &&
117+
window.MaxExtensionFloatingPanel.currentPanelSettings.isVisible) {
118+
// Hide the default container if floating panel should be visible
119+
if (customElementsContainer) {
120+
customElementsContainer.style.display = 'none';
121+
logConCgp('[init] Default button container hidden because floating panel should be visible.');
122+
}
123+
}
124+
}, 200); // Small delay to ensure panel settings have been loaded
112125
}
113126
},
114127

0 commit comments

Comments
 (0)