Skip to content

Commit

Permalink
IBX-7856: Added possibility to add tag with Enter (#1205)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gengar-i authored Mar 19, 2024
1 parent 9c2faf4 commit 6e63ef1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/bundle/Resources/public/js/scripts/fieldType/ezkeyword.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
const SELECTOR_TAGGIFY = '.ibexa-data-source__taggify';
const SELECTOR_ERROR_NODE = '.ibexa-form-error';
const CLASS_TAGGIFY_FOCUS = 'ibexa-data-source__taggify--focused';
const ENTER_KEY_CODE = 13;
const COMMA_KEY_CODE = 188;

class EzKeywordValidator extends ibexa.BaseFieldValidator {
/**
Expand Down Expand Up @@ -70,8 +72,7 @@
containerNode: taggifyContainer,
displayLabel: false,
displayInputValues: false,
// The "," key code
hotKeys: [188],
hotKeys: [ENTER_KEY_CODE, COMMA_KEY_CODE],
});
const keywordInput = field.querySelector('.ibexa-data-source__input-wrapper .ibexa-data-source__input.form-control');
const updateKeywords = updateValue.bind(this, keywordInput);
Expand Down

0 comments on commit 6e63ef1

Please sign in to comment.