Page MenuHomePhabricator

Remarkup toolbar actions always cause comment box to scroll to bottom
Closed, ResolvedPublic

Description

This may be a feature but I figured I'd go ahead and file a task anyways.

Steps to reproduce
Paste a whole bunch of text into a remarkup comment box. Highlight some text at the top that you would like to see bolded and click the B (or any other action) toolbar action. See the window get scrolled to the bottom and you losing place of what you were doing.

I've reproduced this here on secure and on my own install.

Expected Behavior
The window does not scroll and I can continue editing.

This is really minor and I usually I don't even use the toolbar actions but I was feeling extra lazy today.

Revisions and Commits

Restricted Differential Revision

Event Timeline

On OSX, I can't reproduce this in Safari or Firefox, but it does reproduce in Chrome. Are you also using Chrome?

Thanks, I'll see if I can figure out what's going on in Chrome.

So I looked into this and it is the call to area.focus() in the setSelectionRange method in https://secure.phabricator.com/diffusion/P/browse/master/webroot/rsrc/js/core/TextAreaUtils.js (unsure what line, my view of this file is plaintext here) that causes the scrolling. I removed this line and it seemed to have the expected behavior but who knows what other problems removing it may cause.

epriestley added a revision: Restricted Differential Revision.Feb 19 2016, 10:49 PM

Yeah, I came to approximately the same conclusion. Save + restore on the scroll position appears to be a complete fix as far as I can tell.

epriestley closed this task as Resolved by committing Restricted Diffusion Commit.Feb 19 2016, 10:55 PM
epriestley added a commit: Restricted Diffusion Commit.

Ah cool, good to know. Thanks for the quick fix!