Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 29139a1

Browse filesBrowse files
dopplershiftmeeseeksmachine
authored andcommitted
Backport PR #18639: nbagg: Don't close figures for bubbled events.
1 parent ab11910 commit 29139a1
Copy full SHA for 29139a1

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed

‎lib/matplotlib/backends/web_backend/js/nbagg_mpl.js

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/web_backend/js/nbagg_mpl.js
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ mpl.mpl_figure_comm = function (comm, msg) {
4848
console.error('Failed to find cell for figure', id, fig);
4949
return;
5050
}
51-
fig.cell_info[0].output_area.element.one(
51+
fig.cell_info[0].output_area.element.on(
5252
'cleared',
5353
{ fig: fig },
5454
fig._remove_fig_handler
@@ -181,6 +181,10 @@ mpl.figure.prototype._init_toolbar = function () {
181181

182182
mpl.figure.prototype._remove_fig_handler = function (event) {
183183
var fig = event.data.fig;
184+
if (event.target !== this) {
185+
// Ignore bubbled events from children.
186+
return;
187+
}
184188
fig.close_ws(fig, {});
185189
};
186190

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.