From 35a65e5ce8383068f4863755eb1d5b8ceaf707bc Mon Sep 17 00:00:00 2001 From: Robert Swoboda <53216935+Gengar-i@users.noreply.github.com> Date: Tue, 12 Mar 2024 13:13:58 +0100 Subject: [PATCH 1/3] IBX-7856: Added possibility to add tag with Enter --- src/bundle/Resources/public/js/scripts/fieldType/ezkeyword.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bundle/Resources/public/js/scripts/fieldType/ezkeyword.js b/src/bundle/Resources/public/js/scripts/fieldType/ezkeyword.js index 57cf00d786..52e6281bd7 100644 --- a/src/bundle/Resources/public/js/scripts/fieldType/ezkeyword.js +++ b/src/bundle/Resources/public/js/scripts/fieldType/ezkeyword.js @@ -70,8 +70,8 @@ containerNode: taggifyContainer, displayLabel: false, displayInputValues: false, - // The "," key code - hotKeys: [188], + // Key codes "," and "Enter" + hotKeys: [188, 13], }); const keywordInput = field.querySelector('.ibexa-data-source__input-wrapper .ibexa-data-source__input.form-control'); const updateKeywords = updateValue.bind(this, keywordInput); From 8ca0fe63c596e4f39e2202bd1d924e790843c899 Mon Sep 17 00:00:00 2001 From: Robert Swoboda <53216935+Gengar-i@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:09:08 +0100 Subject: [PATCH 2/3] Added variables for keycodes --- .../Resources/public/js/scripts/fieldType/ezkeyword.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bundle/Resources/public/js/scripts/fieldType/ezkeyword.js b/src/bundle/Resources/public/js/scripts/fieldType/ezkeyword.js index 52e6281bd7..27c4f2f7c5 100644 --- a/src/bundle/Resources/public/js/scripts/fieldType/ezkeyword.js +++ b/src/bundle/Resources/public/js/scripts/fieldType/ezkeyword.js @@ -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 COMA_KEY_CODE = 188; class EzKeywordValidator extends ibexa.BaseFieldValidator { /** @@ -70,8 +72,7 @@ containerNode: taggifyContainer, displayLabel: false, displayInputValues: false, - // Key codes "," and "Enter" - hotKeys: [188, 13], + hotKeys: [ENTER_KEY_CODE, COMA_KEY_CODE], }); const keywordInput = field.querySelector('.ibexa-data-source__input-wrapper .ibexa-data-source__input.form-control'); const updateKeywords = updateValue.bind(this, keywordInput); From 2e87be4e77e73b0c1b04fa0ecce920083507bde2 Mon Sep 17 00:00:00 2001 From: Robert Swoboda <53216935+Gengar-i@users.noreply.github.com> Date: Fri, 15 Mar 2024 10:54:02 +0100 Subject: [PATCH 3/3] Misspelling in name --- src/bundle/Resources/public/js/scripts/fieldType/ezkeyword.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bundle/Resources/public/js/scripts/fieldType/ezkeyword.js b/src/bundle/Resources/public/js/scripts/fieldType/ezkeyword.js index 27c4f2f7c5..b88906efff 100644 --- a/src/bundle/Resources/public/js/scripts/fieldType/ezkeyword.js +++ b/src/bundle/Resources/public/js/scripts/fieldType/ezkeyword.js @@ -4,7 +4,7 @@ const SELECTOR_ERROR_NODE = '.ibexa-form-error'; const CLASS_TAGGIFY_FOCUS = 'ibexa-data-source__taggify--focused'; const ENTER_KEY_CODE = 13; - const COMA_KEY_CODE = 188; + const COMMA_KEY_CODE = 188; class EzKeywordValidator extends ibexa.BaseFieldValidator { /** @@ -72,7 +72,7 @@ containerNode: taggifyContainer, displayLabel: false, displayInputValues: false, - hotKeys: [ENTER_KEY_CODE, COMA_KEY_CODE], + 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);