View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
19925 | Bug reports | Survey editing | public | 2025-01-08 11:23 | 2025-01-08 14:40 |
Reporter | 2BITS_PL | Assigned To | gabrieljenik | ||
Priority | none | Severity | minor | ||
Status | assigned | Resolution | open | ||
Product Version | 6.6.x | ||||
Summary | 19925: Multiplication of dropdown-menu DOM element when switching response view mode in LimeSurvey | ||||
Description | There is an issue in LimeSurvey where the dropdown-menu DOM element multiplies during response view mode toggling (Expanded/Compact). Each toggle adds multiple instances of the dropdown-menu element to the DOM. This issue occurs in the same context as the previously reported issue with the #pjaxClickInhibitor element. The prepared fix prevents the multiplication of dropdown-menu elements while maintaining proper DOM refresh functionality. The refresh mechanism has been preserved, even though its necessity is unclear. | ||||
Steps To Reproduce | Steps to Reproduce:
Expected Behavior: Attachments:
| ||||
Tags | No tags attached. | ||||
Attached Files | fixed_multiplication_dropdownmenu.diff (1,593 bytes)
.../admin/grid/GridActionsWidget/assets/action_dropdown.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/application/extensions/admin/grid/GridActionsWidget/assets/action_dropdown.js b/application/extensions/admin/grid/GridActionsWidget/assets/action_dropdown.js index 6c904f3a..c9f99fb8 100644 --- a/application/extensions/admin/grid/GridActionsWidget/assets/action_dropdown.js +++ b/application/extensions/admin/grid/GridActionsWidget/assets/action_dropdown.js @@ -11,9 +11,11 @@ LS.actionDropdown = { document.querySelectorAll('.ls-dropdown-toggle') ); let body = document.querySelector('body'); + let uniqueId = 'dropdown-menu-' + Math.random().toString(36).substr(2, 9); dropdownElementList.map(function (dropdownToggleEl) { let dropdownMenu = dropdownToggleEl.nextElementSibling; if (dropdownMenu !== null) { + dropdownMenu.setAttribute('data-dropdown-id', uniqueId); new LS.actionDropdown.DropdownClass(dropdownToggleEl, { lsMenuElement: dropdownMenu, boundary: body, @@ -21,9 +23,16 @@ LS.actionDropdown = { strategy: 'fixed', }, }); + body.append(dropdownMenu); } }); + document.querySelectorAll('.dropdown-menu').forEach(function (menu) { + if (menu.getAttribute('data-dropdown-id') !== uniqueId) { + menu.remove(); + } + } + ); } }; | ||||
Bug heat | 0 | ||||
Complete LimeSurvey version number (& build) | 6.8.1 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | |||||
Database type & version | SQL Server 2022 | ||||
Server OS (if known) | |||||
Webserver software & version (if known) | |||||
PHP Version | v8.1.29 NTS x64 | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2025-01-08 11:23 | 2BITS_PL | New Issue | |
2025-01-08 11:23 | 2BITS_PL | File Added: fixed_multiplication_dropdownmenu.diff | |
2025-01-08 14:39 | tibor.pacalat | Bug heat | 0 => 2 |
2025-01-08 14:40 | tibor.pacalat | Bug heat | 2 => 0 |
2025-01-08 14:40 | tibor.pacalat | Assigned To | => gabrieljenik |
2025-01-08 14:40 | tibor.pacalat | Status | new => assigned |