[frio] Prevent Enter from sending the form in ACL tags input in /compose

This commit is contained in:
Hypolite Petovan 2019-08-25 21:01:59 -04:00
parent b914900ff5
commit 341046e3a0
2 changed files with 2 additions and 3 deletions

View file

@ -118,7 +118,6 @@
$acl_allow_input.tagsinput({
confirmKeys: [13, 44],
cancelConfirmKeysOnEmpty: true,
freeInput: false,
tagClass: function(item) {
switch (item.type) {

View file

@ -481,9 +481,9 @@
var text = $input.val(),
maxLengthReached = self.options.maxChars && text.length >= self.options.maxChars;
if (self.options.freeInput && (keyCombinationInList(event, self.options.confirmKeys) || maxLengthReached)) {
if (keyCombinationInList(event, self.options.confirmKeys) || maxLengthReached) {
// Only attempt to add a tag if there is data in the field
if (text.length !== 0) {
if (self.options.freeInput && text.length !== 0) {
self.add(maxLengthReached ? text.substr(0, self.options.maxChars) : text);
$input.val('');
}