From 76314a3cf4f8ddccf43f30c6bef4c15764a1bd06 Mon Sep 17 00:00:00 2001 From: shtempel <525@talp.ru> Date: Fri, 27 Jan 2023 18:30:16 +0300 Subject: [PATCH] update enter key press in text input --- .../editor/src/js/components/widgets/InputTextCommonWidget.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/modules/editor/src/js/components/widgets/InputTextCommonWidget.js b/resources/modules/editor/src/js/components/widgets/InputTextCommonWidget.js index b3fd8320d..cdcf828f1 100644 --- a/resources/modules/editor/src/js/components/widgets/InputTextCommonWidget.js +++ b/resources/modules/editor/src/js/components/widgets/InputTextCommonWidget.js @@ -62,12 +62,13 @@ class InputTextCommonWidget extends Component { * @param {{}} e */ handleEnter = e => { + if (!e.target.hasAttribute('data-enter')) return; if (e.keyCode === 13) { e.preventDefault(); const inputs = Array.from(document.querySelectorAll("input[data-enter='enabled'],select")); const index = inputs.indexOf(e.target); if (index === undefined) return; - if (!e.target.hasAttribute('data-enter')) return; + inputs[index + 1] && inputs[index + 1].focus(); const { create_allowed,