Align invitee separators with the server
The server splits the attendee input on whitespace, commas and semicolons, but the search widget only treated commas and semicolons as separators. Typing "a@x.com b" therefore sent the whole string as the search query instead of "b", and picking a contact dropped the whitespace-separated entry. Split on /[\s;,]+/ in both fragment() and commit() so the widget agrees with parseAttendees() on what an entry is.
This commit is contained in:
1 parent
e5432a0a38
commit
5bba3a93cd
2 files changed
+29
-2
No files matched your search
+4
-2
@@ -13,7 +13,9 @@
|
||||
'use strict';
|
||||
|
||||
var DEBOUNCE_MS = 250;
|
||||
var SEPARATOR = /[;,]/;
|
||||
/* Must match the server's attendee parsing: whitespace, comma and
|
||||
* semicolon all separate entries. */
|
||||
var SEPARATOR = /[\s;,]+/;
|
||||
|
||||
var input = document.getElementById('atocal-attendees');
|
||||
|
||||
@@ -59,7 +61,7 @@
|
||||
}
|
||||
|
||||
function commit(email) {
|
||||
var parts = input.value.split(/([;,])/);
|
||||
var parts = input.value.split(/([\s;,]+)/);
|
||||
parts.pop();
|
||||
var prefix = parts.join('').replace(/\s+$/, '');
|
||||
|
||||
|
||||
Reference in new issue
Block a user