#15152 closed bug (fixed)
Selectmenu: incorrect 'remove' event handler management for selectmenu button
Reported by: | AlexShinkin | Owned by: | Scott González |
---|---|---|---|
Priority: | minor | Milestone: | 1.12.2 |
Component: | ui.selectmenu | Version: | 1.12.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description (last modified by )
Might be related to #15078
When a selectmenu is initialised , an internally used <span> section is created that contain button , icon and text.
Each of the components has a set of event listeners .
The bug is - after any activity on a selectmenu ( such as selecting options, just clicking on the menu button a few times, calling .selectmenu("refresh") ) a bunch of 'remove' event handlers gets added to the the selectmenu button.
Looks like the number of the added handlers is equal to the number of menu options. I.e. if a selectmenu has 10 options , clicking on a menu 3 times adds 30 identical handlers to the menu button.
Observed with jQueryUI 1.12.1 and jQuery 1.12.4 and 3.1.1
Easy to reproduce - just load an example page ( like http://jqueryui.com/selectmenu ) , click the selectmenu button a few times , then inspect the button event handlers list .
May ( and most likely does ) cause general slow downs due to memory/cpu starvation.
Regards, Alex
Change History (4)
comment:1 Changed 6 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 6 years ago by
comment:3 Changed 6 years ago by
Owner: | set to Scott González |
---|---|
Resolution: | → fixed |
Status: | new → closed |
In ef2e9ba:
comment:4 Changed 6 years ago by
Milestone: | none → 1.12.2 |
---|
Update:
Initially , after calling .selectmenu() the button has 2 'remove' handlers attached. Calling selectmenu("refresh") adds 2 handlers. Clicking a menu button adds 2 handlers , selecting of an option adds another 2 handlers .