Addepar / ember-widgets

https://opensource.addepar.com/ember-widgets/#/ember-widgets/overview
Other
288 stars 75 forks source link

Ignore resize events that aren't on window #320

Closed bantic closed 5 years ago

bantic commented 5 years ago

We've noticed excessive "resize" events in some app usage that came when jquery-ui.resizable was in use on the page. Because these event handlers are added with jQuery, the "resize" events that resizable fires will be bubbled to the window.

This results in a lot of unnecessary work — the select-component does not need to call updateDropdownLayout unless the window size has actually changed.

bantic commented 5 years ago

Another option would have been to simply use window.addEventListener('resize', which, because it is not attached using jQuery, won't receive the jquery-bubbled events. But this seems the more conservative change.