Browse Source

fix(dashboard): Fix position of bulk actions when in sheet

Michael Bromley 4 months ago
parent
commit
2902e3037d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/dashboard/src/lib/hooks/use-floating-bulk-actions.ts

+ 3 - 1
packages/dashboard/src/lib/hooks/use-floating-bulk-actions.ts

@@ -32,7 +32,9 @@ export function useFloatingBulkActions({
         }
 
         const updatePosition = () => {
-            const container = document.querySelector(containerSelector)?.closest('div') as HTMLElement;
+            // Find the container by searching upwards from the current component
+            const currentElement = document.activeElement || document.body;
+            const container = currentElement.closest(containerSelector) as HTMLElement;
             if (!container) return;
 
             const containerRect = container.getBoundingClientRect();