mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 04:23:46 +00:00
search pills: Update multiple pills creation event behaviour.
If typeahead is used, this adds comma separated search queries so that multiple search pills don't get combined as one and the search behaviour remains same as search_pills_enabled = False case. If typeahead is not used, this prevent the typing of a single comma after the pill gets created.
This commit is contained in:
@@ -283,19 +283,17 @@ exports.create = function (opts) {
|
||||
}
|
||||
}
|
||||
|
||||
// users should not be able to type a comma if the last field doesn't
|
||||
// validate.
|
||||
// Typing of the comma is prevented if the last field doesn't validate,
|
||||
// as well as when the new pill is created.
|
||||
if (char === KEY.COMMA) {
|
||||
// if the pill is successful, it will create the pill and clear
|
||||
// the input.
|
||||
if (funcs.appendPill(store.$input.text().trim()) !== false) {
|
||||
funcs.clear(store.$input[0]);
|
||||
// otherwise it will prevent the typing of the comma because they
|
||||
// cannot add another pill until this input is valid.
|
||||
} else {
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user