Skip to content

Commit 5ff4711

Browse files
committed
fix: use trailingWidth as fallback when expanding inspector for the first time
1 parent 7e20e55 commit 5ff4711

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

TablePro/Views/Components/HorizontalSplitView.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@ struct HorizontalSplitView<Leading: View, Trailing: View>: NSViewRepresentable {
6868
splitView.display()
6969
} else {
7070
trailingView.isHidden = false
71+
let targetWidth = context.coordinator.savedDividerPosition ?? trailingWidth
7172
splitView.adjustSubviews()
72-
if let saved = context.coordinator.savedDividerPosition {
73-
splitView.setPosition(splitView.bounds.width - saved, ofDividerAt: 0)
74-
}
73+
splitView.setPosition(splitView.bounds.width - targetWidth, ofDividerAt: 0)
7574
splitView.display()
7675
}
7776
}

0 commit comments

Comments
 (0)