From 60b2c01a7186fe2af5c23a8d9294df0565a0176c Mon Sep 17 00:00:00 2001 From: Luna D Date: Wed, 21 Oct 2020 19:17:24 +0200 Subject: [PATCH] allow < in tag input (fixes philomena-dev/philomena#35 --- assets/js/tagsinput.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/tagsinput.js b/assets/js/tagsinput.js index e6fe4cfe..1df125a7 100644 --- a/assets/js/tagsinput.js +++ b/assets/js/tagsinput.js @@ -64,7 +64,7 @@ function setupTagsInput(tagBlock) { } function handleKeyEvent(event) { - const { keyCode, ctrlKey } = event; + const { keyCode, ctrlKey, shiftKey } = event; // allow form submission with ctrl+enter if no text was typed if (keyCode === 13 && ctrlKey && inputField.value === '') { @@ -80,7 +80,7 @@ function setupTagsInput(tagBlock) { } // enter or comma - if (keyCode === 13 || keyCode === 188) { + if (keyCode === 13 || (keyCode === 188 && !shiftKey)) { event.preventDefault(); inputField.value.split(',').forEach(t => insertTag(t)); inputField.value = '';