Skip to content

fix(mdviewer): slash menu positioned at right edge instead of cursor#2940

Open
abose wants to merge 1 commit into
mainfrom
ai
Open

fix(mdviewer): slash menu positioned at right edge instead of cursor#2940
abose wants to merge 1 commit into
mainfrom
ai

Conversation

@abose
Copy link
Copy Markdown
Member

@abose abose commented May 24, 2026

The horizontal-overflow clamp in show() wrote a viewport coordinate to menu.style.left, but .slash-menu is position:absolute inside a position:fixed anchor — left is anchor-relative, not viewport-relative. The menu jumped to viewport x ≈ (cursor.x + 895) and stayed there because show() never reset menu.style.left between opens, letting the stale value re-trigger the clamp on every subsequent /.

  • Reset menu.style.left at the start of show()
  • Convert the clamp from viewport coords to anchor-relative

The horizontal-overflow clamp in show() wrote a viewport coordinate to
menu.style.left, but .slash-menu is position:absolute inside a
position:fixed anchor — left is anchor-relative, not viewport-relative.
The menu jumped to viewport x ≈ (cursor.x + 895) and stayed there because
show() never reset menu.style.left between opens, letting the stale value
re-trigger the clamp on every subsequent /.

- Reset menu.style.left at the start of show()
- Convert the clamp from viewport coords to anchor-relative
@sonarqubecloud
Copy link
Copy Markdown

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