Skip to content

Conversation

jasongrout
Copy link
Member

See https://bugs.jquery.com/ticket/9841 - we were having a major slowdown in interact widgets because the output areas were triggering a 'resize' event, which was bubbling up to the window object and running a function which required a DOM read.

…iggered by a bubbled event.

See https://bugs.jquery.com/ticket/9841. In our case, the OutputArea was triggering a ‘resize’ event on its element, which was bubbling up and causing this handler to execute every time an output was appended. This was a pretty big drain on output areas that quickly changed (like for interact widgets), presumably since this function involves a DOM read to get heights.
@jasongrout jasongrout added this to the 4.3.1 milestone Dec 18, 2016
@jasongrout jasongrout changed the title Resize events bubble up to become window.resize events Ignore resize events that bubbled up and didn't come from window. Dec 18, 2016
$('div#site').height($(window).height() - $('#header').height());
// only trigger if the event actually is the window's, not bubbling up.
// See https://bugs.jquery.com/ticket/9841#comment:8
if (!e.target.tagName) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From Travis: e.target is undefined

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From Travis: e.target is undefined

Thanks. I forgot to push my second commit, after I realized that the function is called directly sometimes, without having an event argument.

@minrk minrk merged commit fb8f730 into jupyter:master Dec 19, 2016
minrk added a commit that referenced this pull request Dec 20, 2016
…me from window.

See https://bugs.jquery.com/ticket/9841 - we were having a major slowdown in interact widgets because the output areas were triggering a 'resize' event, which was bubbling up to the window object and running a function which required a DOM read.

Signed-off-by: Min RK <benjaminrk@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants