From 568ab0ff666a731e76ceb242fe09a54bf1c9e963 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 14 Feb 2023 18:24:50 +0100 Subject: [PATCH] Fix tab button on name edit fields [SCI-7922] --- app/assets/javascripts/shared/inline_editing.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/shared/inline_editing.js b/app/assets/javascripts/shared/inline_editing.js index 422495d68..17a113864 100644 --- a/app/assets/javascripts/shared/inline_editing.js +++ b/app/assets/javascripts/shared/inline_editing.js @@ -180,15 +180,14 @@ var inlineEditing = (function() { .removeClass('hidden'); e.stopPropagation(); }) - .on('keyup', `${editBlocks} input`, function(e) { + .on('keydown', `${editBlocks} input`, function(e) { var container = $(this).closest(editBlocks); if (e.keyCode === 13) { updateField(container); + } else if (e.keyCode === 9) { + $(`${editBlocks} .cancel-button`).trigger('click'); } e.stopPropagation(); - }) - .on('blur', `${editBlocks} input`, function() { - $(`${editBlocks} .cancel-button`).trigger('click'); }); $(window).click((e) => {