From 9e387c0eb6b039e87fb081d6c323a02c8d52158c Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 29 May 2020 17:00:06 -0400 Subject: [PATCH] improve keyboard support in kanban cards' tag field --- www/kanban/inner.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/www/kanban/inner.js b/www/kanban/inner.js index 41176d090..c671824d9 100644 --- a/www/kanban/inner.js +++ b/www/kanban/inner.js @@ -302,6 +302,12 @@ define([ _field.setTokens(tags || []); $tags.find('.token-input').on('keydown', function (e) { + // if the tokenfield is blank and the user hits enter or escape + // then allow the event to propogate (closing the modal) + // this can leave behind the autocomplete menu, so forcefully hide it + if (!$(this).val() && [13, 27].indexOf(e.which) !== -1) { + return void $('.ui-autocomplete.ui-front').hide(); + } e.stopPropagation(); });