cxw42 / TabFern

Google Chrome extension for saving and restoring sets of tabs, and for switching between windows and tabs from a vertical, grouped list.
https://cxw42.github.io/TabFern/
Other
170 stars 29 forks source link

Window jumps back to the top after drag and drop #102

Closed cxw42 closed 6 years ago

cxw42 commented 6 years ago

Steps:

  1. Shrink the window so the whole tree doesn't fit
  2. Scroll down
  3. Use drag-and-drop to rearrange two closed windows in the tree

Expected: scroll position doesn't change

Observed: the scroll position snaps back to the very top.

Edit Is this an upstream issue? From a quick look, the completion of the dnd for two closed windows is handled entirely by jstree.

Edit 2 This also happens when dragging an open tab to a closed window.

cxw42 commented 6 years ago

Edit It was in my jstree callbacks, and in jstree' s focus-tracking.

Original

This is in jstree - move_node sometimes calls _redraw with full_redraw==true. A full redraw moves every node out of the tree's DOM (at which point scrollY goes to 0 automatically), then re-adds everything.

cxw42 commented 6 years ago

Update: a simple test on CodePen does not exhibit the behaviour. It might be in one of my custom plugins.