tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
28
pulls
pipelines
pad quotehandler positioning to avoid edge collision
awarm.space
4 months ago
94182057
0f29e2f2
+8
1 changed file
expand all
collapse all
unified
split
app
lish
[did]
[publication]
[rkey]
QuoteHandler.tsx
+8
app/lish/[did]/[publication]/[rkey]/QuoteHandler.tsx
···
83
83
selectionTop += quoteRect.height + 8;
84
84
}
85
85
86
86
+
// Ensure tooltip stays within viewport bounds (330px wide + 8px padding)
87
87
+
const TOOLTIP_WIDTH = 338;
88
88
+
const viewportWidth = window.innerWidth;
89
89
+
const maxLeft = viewportWidth - TOOLTIP_WIDTH;
90
90
+
91
91
+
// Clamp selectionLeft to stay within bounds
92
92
+
selectionLeft = Math.max(8, Math.min(selectionLeft, maxLeft));
93
93
+
86
94
let startIndex = findDataIndex(range.startContainer);
87
95
let endIndex = findDataIndex(range.endContainer);
88
96
if (!startIndex || !endIndex) return;