thdoan / pretty-dropdowns

A simple, lightweight jQuery plugin to create stylized drop-down menus.
https://thdoan.github.io/pretty-dropdowns/
MIT License
105 stars 30 forks source link

Create an OnChange Event (Bubbling) on the Original Select Dropdown? #26

Open casbboy opened 1 year ago

casbboy commented 1 year ago

The select box that is created has a bubbling event listener attached to it:

function(e) {
e.preventDefault(), e.stopImmediatePropagation();
let a = new Array;
const o = _.closest(".thpb_combo_p_grid_pvariants");
o.querySelectorAll(".thpb_combo_p_grid_variant_select").forEach(function(t) {
a.push(t.options[t.selectedIndex].value)
}), t(o, a)
}

When I create the pretty dropdowns, the select form doesn't adjust properly (or change properly) to the changes in the created pretty dropdown). One thing that happens is a dynamic price should change with the change in variable, but it is not happening.

Trying to figure out how to get the select to run the bubbling event when I select an option in the pretty dropdown.