@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

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).

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10396

Differential Revision: https://secure.phabricator.com/D15313

+15 -8
+8 -8
resources/celerity/map.php
··· 8 8 return array( 9 9 'names' => array( 10 10 'core.pkg.css' => '7935f211', 11 - 'core.pkg.js' => '298d5888', 11 + 'core.pkg.js' => '7d8faf57', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '2de124c9', 14 14 'differential.pkg.js' => 'd0cd0df6', ··· 462 462 'rsrc/js/core/Notification.js' => 'ccf1cbf8', 463 463 'rsrc/js/core/Prefab.js' => 'e67df814', 464 464 'rsrc/js/core/ShapedRequest.js' => '7cbe244b', 465 - 'rsrc/js/core/TextAreaUtils.js' => '9e54692d', 465 + 'rsrc/js/core/TextAreaUtils.js' => '5813016a', 466 466 'rsrc/js/core/Title.js' => 'df5e11d2', 467 467 'rsrc/js/core/ToolTip.js' => '6323f942', 468 468 'rsrc/js/core/behavior-active-nav.js' => 'e379b58e', ··· 775 775 'phabricator-slowvote-css' => 'da0afb1b', 776 776 'phabricator-source-code-view-css' => 'cbeef983', 777 777 'phabricator-standard-page-view' => 'e709f6d0', 778 - 'phabricator-textareautils' => '9e54692d', 778 + 'phabricator-textareautils' => '5813016a', 779 779 'phabricator-title' => 'df5e11d2', 780 780 'phabricator-tooltip' => '6323f942', 781 781 'phabricator-ui-example-css' => '528b19de', ··· 1275 1275 'javelin-request', 1276 1276 'javelin-util', 1277 1277 ), 1278 + '5813016a' => array( 1279 + 'javelin-install', 1280 + 'javelin-dom', 1281 + 'javelin-vector', 1282 + ), 1278 1283 '59a7976a' => array( 1279 1284 'javelin-install', 1280 1285 'javelin-dom', ··· 1620 1625 'phuix-action-view', 1621 1626 'phabricator-phtize', 1622 1627 'changeset-view-manager', 1623 - ), 1624 - '9e54692d' => array( 1625 - 'javelin-install', 1626 - 'javelin-dom', 1627 - 'javelin-vector', 1628 1628 ), 1629 1629 '9f36c42d' => array( 1630 1630 'javelin-behavior',
+7
webroot/rsrc/js/core/TextAreaUtils.js
··· 33 33 34 34 setSelectionRange : function(area, start, end) { 35 35 if ('setSelectionRange' in area) { 36 + 37 + // Chrome scrolls the textarea to the bottom as a side effect of 38 + // calling focus(), so save the scroll position, focus, then restore 39 + // the scroll position. 40 + var scroll_top = area.scrollTop; 36 41 area.focus(); 42 + area.scrollTop = scroll_top; 43 + 37 44 area.setSelectionRange(start, end); 38 45 } 39 46 },