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

When the autocompleter would fall off the bottom of the screen, put it above the text instead

Summary: Ref T10163. In cases like Conpherence, the autocompleter can currently render off the bottom of the screen. Put it above if it would be offscreen.

Test Plan: {F1062286}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10163

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

+28 -10
+8 -8
resources/celerity/map.php
··· 507 507 'rsrc/js/phui/behavior-phui-object-box-tabs.js' => '2bfa2836', 508 508 'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8', 509 509 'rsrc/js/phuix/PHUIXActionView.js' => '8cf6d262', 510 - 'rsrc/js/phuix/PHUIXAutocomplete.js' => '377c9b3e', 510 + 'rsrc/js/phuix/PHUIXAutocomplete.js' => '5582787f', 511 511 'rsrc/js/phuix/PHUIXDropdownMenu.js' => 'bd4c8dca', 512 512 'rsrc/js/phuix/PHUIXFormControl.js' => '8fba1997', 513 513 'rsrc/js/phuix/PHUIXIconView.js' => 'bff6884b', ··· 836 836 'phui-workpanel-view-css' => 'adec7699', 837 837 'phuix-action-list-view' => 'b5c256b8', 838 838 'phuix-action-view' => '8cf6d262', 839 - 'phuix-autocomplete' => '377c9b3e', 839 + 'phuix-autocomplete' => '5582787f', 840 840 'phuix-dropdown-menu' => 'bd4c8dca', 841 841 'phuix-form-control-view' => '8fba1997', 842 842 'phuix-icon-view' => 'bff6884b', ··· 1064 1064 'javelin-vector', 1065 1065 'phuix-autocomplete', 1066 1066 ), 1067 - '377c9b3e' => array( 1068 - 'javelin-install', 1069 - 'javelin-dom', 1070 - 'phuix-icon-view', 1071 - 'phabricator-prefab', 1072 - ), 1073 1067 '3ab51e2c' => array( 1074 1068 'javelin-behavior', 1075 1069 'javelin-behavior-device', ··· 1203 1197 'javelin-util', 1204 1198 'javelin-request', 1205 1199 'javelin-typeahead-source', 1200 + ), 1201 + '5582787f' => array( 1202 + 'javelin-install', 1203 + 'javelin-dom', 1204 + 'phuix-icon-view', 1205 + 'phabricator-prefab', 1206 1206 ), 1207 1207 '558829c2' => array( 1208 1208 'javelin-stratcom',
+20 -2
webroot/rsrc/js/phuix/PHUIXAutocomplete.js
··· 232 232 if (this._focus === null && nodes.length) { 233 233 this._setFocus(0); 234 234 } 235 + 236 + this._redraw(); 235 237 }, 236 238 237 239 _setFocus: function(idx) { ··· 440 442 } 441 443 442 444 var node = this._getNode(); 443 - node.style.left = this._x + 'px'; 444 - node.style.top = this._y + 'px'; 445 445 JX.DOM.show(node); 446 + 447 + var p = new JX.Vector(this._x, this._y); 448 + var s = JX.Vector.getScroll(); 449 + var v = JX.Vector.getViewport(); 450 + 451 + // If the menu would run off the bottom of the screen when showing the 452 + // maximum number of possible choices, put it above instead. We're doing 453 + // this based on the maximum size so the menu doesn't jump up and down 454 + // as results arrive. 455 + 456 + var option_height = 30; 457 + var extra_margin = 24; 458 + if ((s.y + v.y) < (p.y + (5 * option_height) + extra_margin)) { 459 + var d = JX.Vector.getDim(node); 460 + p.y = p.y - d.y - 36; 461 + } 462 + 463 + p.setPos(node); 446 464 }, 447 465 448 466 _autocomplete: function() {