fix: a right-aligned menu no longer creeps sideways while it opens (#34227)

This commit is contained in:
G30
2026-11-12 07:44:08 -05:00
committed by GitHub
Unverified
parent 0ae9a1a6e1
commit 3f4316d41b
+1 -1
View File
@@ -206,7 +206,7 @@
const preferredTop = openAbove
? rect.top - constrainedHeight - sideOffset
: rect.bottom + sideOffset;
const contentWidth = contentEl.offsetWidth || 0;
const contentWidth = Math.max(contentEl.scrollWidth || 0, contentEl.offsetWidth || 0);
const preferredLeft = align === 'end' && contentWidth ? rect.right - contentWidth : rect.left;
const maxLeft = contentWidth ? viewportRight - contentWidth - pad : preferredLeft;