ipywidgets
ipywidgets copied to clipboard
clear_output clears the sub_outputs
trafficstars
Description
cc jasongrout jtpio Considering an output (main) containing another output (sub-output), while the main output is displaying, clear_output for the main one would clear the sub-output as well.
Note: to simulate it please keep the order of cells. First cell:
import ipywidgets as widgets
from ipywidgets import Button,Output
from IPython.display import display
out1=Output() #sub-output
but=Button(description='B')
out2=Output() #main output
with out1:
display(but)
with out2:
display(out1)
display(out2)
Second cell:
out2.clear_output()
Third cell:
display(out1)
The result of the last cell is an empty output.

The point is that when the main output is not displaying it works properly.

Expected behavior
It is expected that only the main output would be cleared, and the sub-output would remain unchanged.
