Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Jumping to cursor position in inline editor prevents horizontal scrolling #3696

Closed
lkcampbell opened this issue May 1, 2013 · 4 comments
Closed

Comments

@lkcampbell
Copy link
Contributor

OS: Windows 7

Build: sprint 24 development build 0.24.0-0 (master 58e693b)

Repro Steps:

  1. Open this gist code in Brackets
  2. Go to the very last line and do a Quick Edit on foo().
  3. Scroll down to the last line in the Inline Editor.
  4. Attempt to read the last long comment by scrolling the Inline Editor horizontally to the right.

Observed Behavior:
The Inline Editor jumps back to the top of its code the moment the mouse clicks on the horizontal bar.

Expected Behavior:
The Inline Editor should scroll left and right without a jump so the long comment can be read.

Workaround:
Click on the last line of inline code, resetting the cursor position in the Inline Editor, then use the horizontal scrolling.

@ghost ghost assigned njx May 13, 2013
@pthiess
Copy link
Contributor

pthiess commented May 13, 2013

Reviewed - priority: medium, assigned to NJ

@njx
Copy link

njx commented Jun 12, 2013

The behavior appears to be due to CodeMirror, but I can't quite trace where the scrolling is happening. When clicking on the scrollbar, CodeMirror tries to re-focus the hidden input area (which then leads to the editor refocusing as well). But I can't figure out exactly how that's causing the scroll, as none of the CodeMirror scrollInto...() functions seem to be getting called. I'm thinking that refocusing the hidden input field (which I think is positioned at the cursor location) is making the browser think it should scroll that hidden field into view. I'm not sure why the same issue doesn't occur with the main editor though.

@njx njx assigned RaymondLim and unassigned njx Jul 12, 2014
@njx
Copy link

njx commented Jul 12, 2014

To @RaymondLim

@lkcampbell
Copy link
Contributor Author

This is a strange bug, don't want anyone to have to go down the CodeMirror rabbit hole.

Closing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants