Skip to content

Fix: preventScroll on focus in context-menu#26

Open
webard wants to merge 1 commit into
getartisanflow:devfrom
webard:fix/focus-preventscroll
Open

Fix: preventScroll on focus in context-menu#26
webard wants to merge 1 commit into
getartisanflow:devfrom
webard:fix/focus-preventscroll

Conversation

@webard
Copy link
Copy Markdown

@webard webard commented May 30, 2026

When the context menu opens (htmlEl.focus()) and especially when it closes and restores focus (previousFocus.focus()), the browser runs its default scroll-into-view on the focused element. In any scrollable host layout this yanks the whole page - the panel scrolls out of view, the minimap jumps toward the center, and the canvas appears to shift ~200–300px on every menu dismiss.

The fix is to pass { preventScroll: true } to these .focus() calls so focus is moved without scrolling.

@zachiler zachiler changed the base branch from main to dev June 2, 2026 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant