Page MenuHomePhabricator

Save, then restore scroll position in Chrome textareas on remarkup assist
ClosedPublic

Authored by epriestley on Feb 19 2016, 10:49 PM.
Tags
None
Referenced Files
F13099478: D15313.diff
Fri, Apr 26, 3:19 PM
Unknown Object (File)
Thu, Apr 25, 12:07 PM
Unknown Object (File)
Sun, Apr 21, 5:45 PM
Unknown Object (File)
Sat, Apr 6, 2:37 AM
Unknown Object (File)
Fri, Mar 29, 7:58 AM
Unknown Object (File)
Thu, Mar 28, 4:13 PM
Unknown Object (File)
Mar 10 2024, 5:46 PM
Unknown Object (File)
Mar 5 2024, 9:21 AM
Subscribers
None

Details

Summary

Fixes T10396. Seems like this has been around for a while (references from 2011):

http://stackoverflow.com/questions/4002312/chrome-resets-the-textarea-scroll-bar-scrolltop-when-focus-is-called
https://bugs.chromium.org/p/chromium/issues/detail?id=75072

Commenting out this focus() seemed to fix the issue locally, at the cost of not focusing.

Saving, focusing, then restoring seems to produce the correct behavior everywhere.

Test Plan
  • In Safari, Firefox and Chrome, typed a ton of text into a remarkup area (more than the height of the area, so it has a scrollbar).
  • Selected some text near the top.
  • Clicked "B" to bold the text.
  • Scroll position remained the same in all browsers (previously: in Chrome, it changed).

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Save, then restore scroll position in Chrome textareas on remarkup assist.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.
This revision is now accepted and ready to land.Feb 19 2016, 10:53 PM
This revision was automatically updated to reflect the committed changes.