Commit c66c9ce
committed
fix(mdviewer): slash menu positioned at right edge instead of cursor
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-relative1 parent 6275b71 commit c66c9ce
2 files changed
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
234 | 238 | | |
235 | 239 | | |
236 | 240 | | |
| |||
251 | 255 | | |
252 | 256 | | |
253 | 257 | | |
254 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
255 | 261 | | |
256 | 262 | | |
257 | | - | |
| 263 | + | |
| 264 | + | |
258 | 265 | | |
259 | 266 | | |
260 | 267 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments