Opened 9 years ago

Closed 9 years ago

#10636 closed bug (notabug)

add more evet listener on selectmenu

Reported by: janom Owned by:
Priority: minor Milestone: none
Component: ui.selectmenu Version: 1.11.0
Keywords: Cc:
Blocked by: Blocking:

Description

when change mySelect i got two alert, but when i change mySelectUi a got only second alert

<body>
<select id="mySelect" >
<option value="1">1111111</option>
<option value="2">2222222</option>
<option value="3">3333333</option>
</select>
<select id="mySelectUi" >
<option value="1">1111111</option>
<option value="2">2222222</option>
<option value="3">3333333</option>
</select>
<script type="text/javascript" >
jQuery("#mySelectUi").selectmenu();
function a1(event, ui){ alert("a1"); }
function a2(event, ui){ alert("a2"); }

document.getElementById("mySelect").addEventListener("change", a1);
document.getElementById("mySelect").addEventListener("change", a2);
jQuery("#mySelectUi").selectmenu({ change: a1 });
jQuery("#mySelectUi").selectmenu({ change: a2 });
</script>
</body>

Change History (2)

comment:2 Changed 9 years ago by Scott González

Resolution: notabug
Status: newclosed

The native change event and the custom change event are not the same thing. Please ask for help on the forums, IRC, or Stack Overflow.

Note: See TracTickets for help on using tickets.