Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13986680
D15033.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
D15033.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' => '3d6e37cc',
+ 'rsrc/js/phuix/PHUIXAutocomplete.js' => '3dfff01f',
'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' => '3d6e37cc',
+ 'phuix-autocomplete' => '3dfff01f',
'phuix-dropdown-menu' => 'bd4c8dca',
'phuix-form-control-view' => '8fba1997',
'phuix-icon-view' => 'bff6884b',
@@ -1080,7 +1080,7 @@
'javelin-util',
'javelin-uri',
),
- '3d6e37cc' => array(
+ '3dfff01f' => array(
'javelin-install',
'javelin-dom',
'phuix-icon-view',
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
@@ -119,6 +119,16 @@
return;
}
+ // Get all the text on the current line. If the line begins with
+ // whitespace, don't activate: the user is probably typing code or a
+ // numbered list.
+ var line = area.value.substring(0, head);
+ line = line.split('\n');
+ line = line[line.length - 1];
+ if (line.match(/^\s+/)) {
+ return;
+ }
+
this._cursorHead = head;
this._cursorTail = range.end;
this._pixelHead = JX.TextAreaUtils.getPixelDimensions(
@@ -370,6 +380,13 @@
var x = this._pixelHead.start.x;
var y = Math.max(this._pixelHead.end.y, pixels.end.y) + 24;
+ // If the first character after the trigger is a space, just deactivate
+ // immediately. This occurs if a user types a numbered list using "#".
+ if (text.length && text[0] == ' ') {
+ this._deactivate();
+ return;
+ }
+
var trim = this._trim(text);
this._datasource.didChange(trim);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 22, 4:49 AM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6740586
Default Alt Text
D15033.diff (2 KB)
Attached To
Mode
D15033: Improve autocomplete behavior when typing ordered lists
Attached
Detach File
Event Timeline
Log In to Comment