Skip to content

Commit

Permalink
Add recommended id and order props to resizable panels
Browse files Browse the repository at this point in the history
Also fix warning about invalid layout when detail view is not showing.
  • Loading branch information
maiwald committed Nov 12, 2024
1 parent 56ad75b commit 234fed6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions app/packs/src/apps/mydb/elements/Elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ export default function Elements() {
ref={panelRef}
onLayout={onLayout}
>
<Panel collapsible defaultSize={defaultLayout[0]} className="w-0">
<Panel
id="elements-list-view"
order={1}
collapsible
defaultSize={showDetailView ? defaultLayout[0] : 100}
className="w-0"
>
<div className="h-100 pt-3 px-3 overflow-x-auto">
<div className="h-100" style={{ minWidth: '600px' }}>
<ElementsList overview={!showDetailView} />
Expand All @@ -72,7 +78,12 @@ export default function Elements() {
<i className={`fa fa-angle-double-${isCollapsed ? 'right' : 'left'}`} />
</Button>
</PanelResizeHandle>
<Panel defaultSize={defaultLayout[1]} className="w-0">
<Panel
id="elements-detail-view"
order={2}
defaultSize={defaultLayout[1]}
className="w-0"
>
<div className="h-100 pt-3 px-3 overflow-x-auto">
<div className="h-100" style={{ minWidth: '680px' }}>
<ElementDetails />
Expand Down

0 comments on commit 234fed6

Please sign in to comment.