Skip to content

Nested Dock Panel sometimes does not hide overlay when drag and drop tabs #833

Description

@YuantaiWei

Description

When there is a dock panel inside another dock panel, dragging tabs between them sometimes will have two dock panel overlays showing at the same time, dropping while having two overlay showing will only hide one of the overlay and the other one will persist.

Image

Reproduce

  1. Go to 'example-dockpanel'
  2. Modify the index.ts in example to create a outer dock panel which contains the original dock panel, this is the git diff result of the modified file and the original file:
@@ -396,6 +396,9 @@ function main(): void {
   // let g2 = new ContentWidget('Green');
   // let y2 = new ContentWidget('Yellow');
 
+  let outerDock = new DockPanel();
+  outerDock.id = 'outer-dock';
+
   let dock = new DockPanel();
   dock.addWidget(r1);
   dock.addWidget(b1, { mode: 'split-right', ref: r1 });


@@ -405,6 +408,8 @@ function main(): void {
   dock.addWidget(b2, { mode: 'split-right', ref: y1 });
   dock.id = 'dock';
 
+  outerDock.addWidget(dock);
+
   dock.addRequested.connect((sender: DockPanel, arg: TabBar<Widget>) => {
     let w = new ContentWidget('Green');
     sender.addWidget(w, { ref: arg.titles[0].owner });


@@ -518,12 +523,12 @@ function main(): void {
     rank: 0
   });
 
-  BoxPanel.setStretch(dock, 1);
+  BoxPanel.setStretch(outerDock, 1);
 
   let main = new BoxPanel({ direction: 'left-to-right', spacing: 0 });
   main.id = 'main';
   main.addWidget(palette);
-  main.addWidget(dock);
+  main.addWidget(outerDock);
 
   window.onresize = () => {
     MessageLoop.postMessage(bar, new Widget.ResizeMessage(-1, -1));
  1. Try to drag the tab from inner dock panel to the tab bar of the outer dock panel and drag it back to the inner dock panel tab bar, when there are two overlay showing at the same time, drop the tab. (In this example, referring to the screenshot, try to drag the tab "Red" between the tab bars until there are 2 different overlay showing at the same time).
Image
  1. One of the overlay will persist after drop.

Expected behavior

There should not be any overlay remaining after drop.

Context

  • Operating System and version: Windows 11
  • Browser and version: FireFox 152.0.4
  • JupyterLab version:
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here, if applicable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions