a tool for shared writing and social publishing

pad quotehandler positioning to avoid edge collision

+8
+8
app/lish/[did]/[publication]/[rkey]/QuoteHandler.tsx
··· 83 83 selectionTop += quoteRect.height + 8; 84 84 } 85 85 86 + // Ensure tooltip stays within viewport bounds (330px wide + 8px padding) 87 + const TOOLTIP_WIDTH = 338; 88 + const viewportWidth = window.innerWidth; 89 + const maxLeft = viewportWidth - TOOLTIP_WIDTH; 90 + 91 + // Clamp selectionLeft to stay within bounds 92 + selectionLeft = Math.max(8, Math.min(selectionLeft, maxLeft)); 93 + 86 94 let startIndex = findDataIndex(range.startContainer); 87 95 let endIndex = findDataIndex(range.endContainer); 88 96 if (!startIndex || !endIndex) return;