From d5356387b7e0bdcef56a4b8421136fe9ee91742b Mon Sep 17 00:00:00 2001 From: Andrey Smakotin Date: Tue, 11 Nov 2025 00:17:51 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=BB=D0=BE=D0=B3=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=BB=D1=8F=20=D0=BE=D1=82=D0=BB?= =?UTF-8?q?=D0=B0=D0=B4=D0=BA=D0=B8=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8?= =?UTF-8?q?=D0=B8=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавлены логи на разных стадиях: - 9_open: когда dropdown открывается - 9_search: когда resultsContainer найден - 9_click: когда пользователь кликает - 9_option: когда находится select2-results__option - 9_create: когда находится customer-create-option - 9_text: полный текст опции - 9d: когда открывается модаль Это поможет определить на каком этапе может быть проблема. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- myproject/orders/templates/orders/order_form.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/myproject/orders/templates/orders/order_form.html b/myproject/orders/templates/orders/order_form.html index 2070ede..46a8c7c 100644 --- a/myproject/orders/templates/orders/order_form.html +++ b/myproject/orders/templates/orders/order_form.html @@ -568,20 +568,26 @@ function initCustomerSelect2() { // Обработчик прямого клика на результаты (для "create option") $customerSelect.on('select2:opening', function(e) { + console.log('9_open. Dropdown открывается, добавляем обработчик клика'); // Добавляем обработчик на клик по результатам в следующем event tick setTimeout(function() { const resultsContainer = document.querySelector('.select2-results'); + console.log('9_search. resultsContainer найден:', !!resultsContainer); if (resultsContainer) { resultsContainer.addEventListener('click', function handleCreateOptionClick(event) { + console.log('9_click. Клик по результатам:', event.target); const target = event.target.closest('.select2-results__option'); + console.log('9_option. Ближайший option:', target); if (!target) return; // Проверяем содержит ли элемент класс customer-create-option const createOptionDiv = target.querySelector('.customer-create-option'); + console.log('9_create. create option найден:', !!createOptionDiv); if (createOptionDiv) { console.log('9c. Клик на create option напрямую'); // Получаем текст опции const fullText = target.textContent.trim(); + console.log('9_text. Полный текст:', fullText); // Извлекаем поисковый текст (удаляем "Создать клиента: ") const searchText = fullText.replace(/^\s*[\s\S]+?:\s*"([^"]*)"\s*$/, '$1') || fullText;