-
-
Notifications
You must be signed in to change notification settings - Fork 473
Autocomplete tooltip invisible when using EditorView.scrollMargins #1689
Copy link
Copy link
Closed
Description
Describe the issue
There is a positioning conflict between the autocompletion tooltip and EditorView.scrollMargins. When typing a character (e.g. 'f') at the very beginning of a document, the autocomplete menu is initialized but remains invisible.
Testcase:
- https://krpano.com/codemirror/bugs/scrollmargins-and-tooltips.html
- a sandbox example is also included below
Steps to Reproduce:
- Use EditorView.scrollMargins with a significant margin (e.g. 100px).
- Start with an empty JavaScript document.
- Type a single character (like 'f') in the first line.
- The cursor becomes "trapped" (arrow up/down keys stop working) because the autocomplete keymap is active, but the menu is positioned far off-screen.
Expected Behavior:
- The tooltip should be positioned correctly at the cursor, even if the cursor is within the defined scrollMargins.
Observed Behavior:
- The tooltip is invisible (css top position of -10000px).
- The cursor is trapped, up/down keys do not to work.
- Pressing ESC closes the invisible menu and restores normal cursor movement.
- Occurs when scrollMargins are larger than the distance from the cursor to the editor edge.
Environment:
- CodeMirror 6
- @codemirror/view (latest)
- @codemirror/autocomplete (latest)
Browser and platform
No response
Reproduction link
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels