-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clicking on multi-line selection inside inline editor jumps scroll position way downward #13059
Comments
Comment by peterflynn The "scroll" event callstack shows nothing -- it's being triggered natively, not via JS. The scroll happens immediately on mousedown (no mousemove, mouseup, or click needed). Looking at a Timelines capture, codemirror responds to the mousedown with My guess is that CM's hidden textarea is getting positioned incorrectly, and when it's focused the browser then tries to scroll it into view (which is standard behavior when focusing any element that's out of view). The focus change itself may be a bug, since focus appears to be nowhere useful after you mouseup. Or it may be expected, while the badly positioned focus element is the bug. Either way, seems like it's likely to be a bug on CM's side, not ours... |
Comment by peterflynn The blur event is changing focus from the inline editor's hidden textarea to the inline editor's |
Comment by peterflynn Turns out the With drag & drop disabled, CodeMirror calls But the momentary focus change happens on every mousedown in any CM widget when drag & drop is enabled. Yet it only causes spurious scrolling in a JS inline editor -- hopefully poking at that will lead to a fix. |
Comment by MarcelGerber Just FYI, I'm completely unable to repro this bug. I'm on Windows 8.1, using the latest (downloaded) prerelase shell and with brackets |
Comment by peterflynn
I'm on Mac 10.9 -- it's possible this could be a Mac-only bug... Can anyone else confirm? |
Comment by RaymondLim
|
Comment by JeffryBooher I don't see it on Windows 8.1 |
Comment by RaymondLim I can't reproduce it on windows either. Selecting the highlighted with double-click always ends up with selecting only the word that clicked on. |
Comment by peterflynn Good observation As a test, I wired up the inline editor to always just show the top of index.html, and it still happens (so the content of the inline editor need not be a JS file). I also rewired the provider to respond 100% of the time, and it still happens even when the outer editor is just a plain text file. This means it does repro even with the CSS inline editor, in the right circumstances -- making this higher priority than I'd originally thought. The bug is sensitive to a number of factors: how far below the top of the viewport the inline editor is opened (too high up and it won't repro; lower down the scroll jumps gets larger), window height (taller window requires opening the editor lower down before it will start to repro), and how many lines are spanned by the selection inside the inline editor (selecting more lines makes it start reproing higher up, and it scrolls down more lines total). That last bit reminds me of #3376, which also varies with how many lines you have selected -- and which we never got to the bottom of either :-( |
Comment by peterflynn
|
Comment by RaymondLim Disregard double-clicking. I was referring to the step 4 to click inside the selected text. Single click just sets the cursor to where you click on Windows, but double-click always selects the word you click on. |
Comment by peterflynn I'm able to reproduce this running Brackets in-browser, but so far I'm not able to reproduce this with a simpler standalone CM testcase (https://gist.github.com/peterflynn/0f6cd0af22edb543f56f). That's both good and bad news: it suggests there's not a fundamental problem with CM's drag/drop mechanism, but the bad news is it could be very hard to tease apart what's different between Brackets and the simpler CM testcase... |
Comment by peterflynn Spoke too soon! If you scroll things just right, it will in fact repro in the standalone CM testcase too -- score! |
Comment by peterflynn |
Comment by le717
|
Comment by nethip I am moving this out to 1.4 as we are going to pull latest version of code mirror only in 1.4 |
Comment by nethip
|
Issue by peterflynn
Friday Feb 13, 2015 at 07:42 GMT
Originally opened as adobe/brackets#10590
New repro steps with Getting Started project
<h3>
on line 61 ("Quick Edit for CSS and JavaScript")<h3>
tagIf it doesn't repro, scroll so the
<h3>
is further down from the top of the viewport before step 3, or make your window less tall.Old repro steps with JS inline editor
_getModeFromDocument()
call and press Ctrl-EResult: scroll position jumps down about 250 lines, and focus is lost from the editor
Expected: selection cleared and cursor remains in inline editor
This looks like a regression due to PR #9584 -- if I disable text drag & drop via preferences, the bug goes away. CC
@
MarcelGerberI'm only able to repro this in the JS inline editor -- not in the CSS inline editor. If it occurred in the CSS inline editor I think we'd want to block the 1.2 release until a fix is available (or make drag & drop off by default). If it really only repros in the JS inline editor, I'm less sure... Seems like we should investigate to at least see if there's an easy fix, though.
The text was updated successfully, but these errors were encountered: