Close a widget but the associate '<div class="output_area">' still exists
See original GitHub issueSince 7.0 widgets in notebook are rendered in <div class="output_area">
,
but when I close a widget, the associate <div class="output_area">
still exists.
from ipywidgets import Layout, Button, Box
from IPython.display import display
items = [Button(description='example') ]
box1 = Box(children=items)
box2 = Box(children=items)
box3= Box(children=items)
display(box1)
display(box2)
display(box3)
box2.close()
output:
How could I remove this part ?
Issue Analytics
- State:
- Created 6 years ago
- Comments:22 (12 by maintainers)
Top Results From Across the Web
Delete old widgets from iPhone - Apple Community
I can add and delete the newer widgets but I cannot delete all the old ones that are still there of which most...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Are we gonna solve this issue in ipywidgets or jupyter? As of today (ipywidgets 7.5.0, jupyterlab 1.0.1, this empty div problem is still there.
FYI I identified the source of the problem in JupyterLab – each removed output is nested in some two additional divs:
While 2nd inner div with
p-mod-hidden
getsdisplay: none
CSS the firstjp-OutputPrompt jp-OutputArea-prompt
has non-zero padding and border, even when has no content at all, causing the space to grow. I believe this is a problem at the junction of ipywidgets and JupyterLab. I don’t know if there is a way to remove output completely (instead hiding it), so these divs do not remain at all. My current workaround is an additional CSS:This is far from perfect as still the internal DOM grows with empty divs, we just don’t see that anymore. And btw. please re-open this issue as the problem is NOT fixed.