microsoft / monaco-editor

A browser based code editor
https://microsoft.github.io/monaco-editor/
MIT License
39.92k stars 3.56k forks source link

[Bug] Click beyond last line while there is horizontal scroll selects part of the last line #2849

Open mifopen opened 2 years ago

mifopen commented 2 years ago

Reproducible in vscode.dev or in VS Code Desktop?

Reproducible in the monaco editor playground?

Monaco Editor Playground Code

monaco.editor.create(document.getElementById('container'), {
    value: "function hello() {\n\talert('Hello world!');\n}  function hello() {     alert('Hello world!'); }  function hello() {    alert('Hello world!'); }",
    language: 'javascript'
});

Actual Behavior

  1. Click somewhere under the last line
  2. Part of the last line is selected, the scroll is moved.

Expected Behavior

  1. Click somewhere under the last line
  2. Cursor is set to the end of the last line (VSCode behaviour)

Additional Context

No response

hediet commented 2 years ago

I cannot reproduce the actual behavior. Can you share a video?

mifopen commented 2 years ago

Sure! Screen Cast 2022-01-04 at 10 40 27 AM

hediet commented 2 years ago

For me, this only happens while pressing alt+shift (on Windows). What browser do you use? Can someone else reproduce this?

mifopen commented 2 years ago

macOS Monterey 12.0.1 (21A559) Google Chrome Version 96.0.4664.110 (Official Build) (x86_64)

rcjsuen commented 2 years ago

Can someone else reproduce this?

@hediet I can reproduce this on 64-bit Edge 96.0.1054.62. I'm on Windows 10 Home 21H1 19043.1415.

hediet commented 2 years ago

Ok, now I can also reproduce consistently. Must have been a cache issue.