fix: floating panel ResizeObserver broken by fragment index shift
Context menu insertion before floatingPanel shifted its fragment index, causing React to unmount/recreate the DOM element on DM↔space transitions. The ResizeObserver was left observing the old detached element, so paddingBottom never adjusted and channels scrolled behind the panel. - Reorder fragment children so floatingPanel is at index 1 in both views - Replace useRef with callback ref so ResizeObserver reattaches on remount - Add stopPropagation to ContextMenu to prevent sidebar menu conflicts - Restyle sidebar create channel/category buttons (smaller, separated)
This commit is contained in:
@@ -19,6 +19,7 @@ export function ContextMenu({ items, children }: ContextMenuProps) {
|
||||
|
||||
const handleContextMenu = (e: React.MouseEvent) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
setPosition({ x: e.clientX, y: e.clientY });
|
||||
setIsOpen(true);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user