Commit b5cde86
committed
nbagg: Don't close figures for bubbled events.
In JavaScript, the event handlers are called for both the element and
also bubbled up from any children. If the Matplotlib figure is the only
thing in the output, that's fine, as closing the figure when one of the
`canvas` or `div`s clears is the same as when the `OutputArea` is
cleared. However, if there are other outputs, such as widgets, we do not
want to close the figure if one of them is cleared.
As there's no way to clear just the figure output, only close the figure
if the _entire_ `OutputArea` div is cleared (i.e., the element we've
attached to).
Fixes #18638.1 parent 8699958 commit b5cde86
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
184 | 188 | | |
185 | 189 | | |
186 | 190 | | |
| |||
0 commit comments