Skip to content

Commit c30fd2a

Browse files
committed
Fix: Prevent toggling of context menu on window resize
1 parent 50f76c5 commit c30fd2a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/ui/src/lib/ContextMenu.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,11 @@
173173
horizontalAlign = 'left';
174174
setAlignment();
175175
}
176-
if (rect.bottom > viewport.bottom) {
177-
side = 'top';
178-
setAlignment();
176+
if (rect.bottom > viewport.bottom && rect.top > viewport.top) {
177+
setTimeout(() => {
178+
side = 'top';
179+
setAlignment();
180+
}, 0)
179181
}
180182
if (rect.top < viewport.top) {
181183
side = 'bottom';

0 commit comments

Comments
 (0)