From 53ada57d3438c2e1727b2ce89c65237480909901 Mon Sep 17 00:00:00 2001 From: ezwrk Date: Tue, 30 Jul 2024 10:08:38 +0300 Subject: [PATCH] Fixed comboboxes value changing upon opening them (also fixes tab manipulation in cases where the script can't find an appropriate auth control L#144) --- src/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index da8f368..4f5f360 100644 --- a/src/main.js +++ b/src/main.js @@ -1172,7 +1172,7 @@ function option_selected(event, element) { menu.style.display = 'none' } -function open_combobox() { +function open_combobox(event) { let combobox = this while (!(combobox.classList?.contains('dropdown'))) { combobox = combobox.parentElement @@ -1198,10 +1198,12 @@ function open_combobox() { item.setAttribute('selected', false) } } - button.value = this.textContent + // this changes value of the combobox to its *text* value (i.e. the visible one) and botches all the comboboxes logic + //button.value = this.textContent menu.style.display = 'block' } combobox.setAttribute('opened', !opened) + event.stopPropagation() } function init_comboboxes() {