From 34182d8d470a3a9612dcbe60b93d65b753ed0aa4 Mon Sep 17 00:00:00 2001 From: Alexander Nikushkin Date: Wed, 5 Feb 2025 22:06:58 +0500 Subject: [PATCH] fix: focus choices issue #1523 --- src/UI/resources/js/Components/Select.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/UI/resources/js/Components/Select.js b/src/UI/resources/js/Components/Select.js index d66d4ecbd..277ad4b8b 100644 --- a/src/UI/resources/js/Components/Select.js +++ b/src/UI/resources/js/Components/Select.js @@ -288,7 +288,10 @@ export default (asyncUrl = '') => ({ if (this.removeItemButton) { this.$el.parentElement.addEventListener('click', event => { - event.target.closest('.choices')?.querySelector('select')?.focus() + if (document.activeElement.name !== 'search_terms') { + // necessary for reactivity to work + event.target.closest('.choices')?.querySelector('select')?.focus() + } if (event.target.classList.contains('choices__button--remove')) { const choiceElement = event.target.closest('.choices__item')