You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within the left side, have two tool windows; one at the top (primary) and one at the bottom (secondary).
Open the secondary, leaving the primary closed.
Open the primary.
The focus should be moved to the primary tool window when it opens, but it will remain in the secondary.
Problem
The focus doesn't actually "remain" within the secondary tool window. The secondary tool window is remounted as the primary window is mounted. Both will attempt to autofocus on mount and the second one wins, simply because it's rendered after the primary one.
Explanation
In SideDockedState, primary and secondary tool windows are normalized into a main and split view. When only the secondary window is opened, it will take up the main slot. When both windows are open, the secondary window will take up the split slot. So the secondary window will be re-mounted because it's moved across react tree.
Potential solution
Always render the primary and secondary windows in the same place in react tree. Render null if one is empty. There may be a need for change in ThreeViewSplitter, in case it doesn't properly support only passing lastView.
Reproduction scenario:
The focus should be moved to the primary tool window when it opens, but it will remain in the secondary.
Problem
The focus doesn't actually "remain" within the secondary tool window. The secondary tool window is remounted as the primary window is mounted. Both will attempt to autofocus on mount and the second one wins, simply because it's rendered after the primary one.
Explanation
In
SideDockedState
, primary and secondary tool windows are normalized into amain
andsplit
view. When only the secondary window is opened, it will take up themain
slot. When both windows are open, the secondary window will take up thesplit
slot. So the secondary window will be re-mounted because it's moved across react tree.Potential solution
Always render the primary and secondary windows in the same place in react tree. Render null if one is empty. There may be a need for change in
ThreeViewSplitter
, in case it doesn't properly support only passinglastView
.Test case
jui/packages/jui/src/ToolWindowsImpl/DefaultToolWindows.cy.tsx
Lines 163 to 189 in f38065c
The text was updated successfully, but these errors were encountered: