dropdown for product variant picker

main
alexanderroese 2024-07-13 18:03:05 +02:00
parent 0e45d977e8
commit 173f0d2361
1 changed files with 4 additions and 0 deletions

View File

@ -172,6 +172,10 @@
// Set the selected option in the original select element
selectElement.value = selectedVariant;
// Trigger change event
const eventChange = new Event('change', { bubbles: true });
selectElement.dispatchEvent(eventChange);
// Remove the selected style from all items
document.querySelectorAll('.shx-custom-dropdown-content div').forEach(div => {
div.classList.remove('shx-custom-selected-variant');