Closed brichet closed 11 months ago
Thanks a lot for digging this one up @brichet
I would rather avoid adding a new attribute for this.
Looking at the current behavior, when the dock panel creates a split, it adds a tab bar. When that tab bar is attached to the panel, its parent
is set.
That triggers the child-added
/ child-removed
message listened by the focus tracker.
The addition of the split handle does not triggered such messages as they are directly attached to the HTML element.
This is actually wrong as adding/removing a tab bar should be transparent for dock panels. The message child-added
and child-removed
should only be triggered for child panels.
The wrong behavior can also be seen in JupyterLab by the wrongly addition of the class jp-Activity
to the tab bars (it should only be on the MainAreaWidget
) :
Therefore I think a better fix would be to not set the tab bar parent, simply attaching it as it is done for the handle.
cc @afshin @krassowski what do you think?
Another approach could be the inhibition of the
child-added
/child-removed
message emission. But I don't see a good way of doing this without overriding theset parent
method of the tab bar. But then it may have unwanted effect for downstream code consuming tab bar outside a dock panel (like the weird usage in the JupyterLab sidebars).
Therefore I think a better fix would be to not set the tab bar parent, simply attaching it as it is done for the handle.
Thanks for the suggestion @fcollonval, I reverted the previous changes and add a commit to avoid setting the parent of the tab bar.
This PR fixes https://github.com/jupyterlab/lumino/issues/604
It adds an attribute to Widget to disable the tracking fromfocusTracker
, event if its elements can get the focus.By default all the widgets are trackable, except for theTabBar
.It avoids setting the parent of the tab bar in the dock panel.