Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13992414
D15036.id36317.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D15036.id36317.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -507,7 +507,7 @@
'rsrc/js/phui/behavior-phui-object-box-tabs.js' => '2bfa2836',
'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8',
'rsrc/js/phuix/PHUIXActionView.js' => '8cf6d262',
- 'rsrc/js/phuix/PHUIXAutocomplete.js' => '3601bdd1',
+ 'rsrc/js/phuix/PHUIXAutocomplete.js' => '569edc21',
'rsrc/js/phuix/PHUIXDropdownMenu.js' => 'bd4c8dca',
'rsrc/js/phuix/PHUIXFormControl.js' => '8fba1997',
'rsrc/js/phuix/PHUIXIconView.js' => 'bff6884b',
@@ -836,7 +836,7 @@
'phui-workpanel-view-css' => 'adec7699',
'phuix-action-list-view' => 'b5c256b8',
'phuix-action-view' => '8cf6d262',
- 'phuix-autocomplete' => '3601bdd1',
+ 'phuix-autocomplete' => '569edc21',
'phuix-dropdown-menu' => 'bd4c8dca',
'phuix-form-control-view' => '8fba1997',
'phuix-icon-view' => 'bff6884b',
@@ -1064,12 +1064,6 @@
'javelin-vector',
'phuix-autocomplete',
),
- '3601bdd1' => array(
- 'javelin-install',
- 'javelin-dom',
- 'phuix-icon-view',
- 'phabricator-prefab',
- ),
'3ab51e2c' => array(
'javelin-behavior',
'javelin-behavior-device',
@@ -1210,6 +1204,12 @@
'javelin-vector',
'javelin-dom',
),
+ '569edc21' => array(
+ 'javelin-install',
+ 'javelin-dom',
+ 'phuix-icon-view',
+ 'phabricator-prefab',
+ ),
'56a1ca03' => array(
'javelin-behavior',
'javelin-behavior-device',
diff --git a/webroot/rsrc/js/phuix/PHUIXAutocomplete.js b/webroot/rsrc/js/phuix/PHUIXAutocomplete.js
--- a/webroot/rsrc/js/phuix/PHUIXAutocomplete.js
+++ b/webroot/rsrc/js/phuix/PHUIXAutocomplete.js
@@ -276,7 +276,13 @@
},
_getSuffixes: function() {
- return[' ', ':', ','];
+ return [' ', ':', ',', ')'];
+ },
+
+ _getCancelCharacters: function() {
+ // The "." character does not cancel because of projects named
+ // "node.js" or "blog.mycompany.com".
+ return ['#', '@', ',', '!', '?'];
},
_trim: function(str) {
@@ -392,6 +398,18 @@
var trim = this._trim(text);
+ // Deactivate immediately if a user types a character that we are
+ // reasonably sure means they don't want to use the autocomplete. For
+ // example, "##" is almost certainly a header or monospaced text, not
+ // a project autocompletion.
+ var cancels = this._getCancelCharacters();
+ for (var ii = 0; ii < cancels.length; ii++) {
+ if (trim.indexOf(cancels[ii]) !== -1) {
+ this._deactivate();
+ return;
+ }
+ }
+
this._datasource.didChange(trim);
var node = this._getNode();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 23, 4:27 PM (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6744678
Default Alt Text
D15036.id36317.diff (2 KB)
Attached To
Mode
D15036: Immediately cancel autocomplete if the user types certain characters anywhere
Attached
Detach File
Event Timeline
Log In to Comment