mirror of
https://github.com/microsoft/playwright.git
synced 2025-01-05 19:04:43 +03:00
fix(ui): bump min sidebar size (#24193)
This commit is contained in:
parent
18dfe680f5
commit
33bab3652d
@ -171,7 +171,7 @@ export const UIModeView: React.FC<{}> = ({
|
||||
<div className='title'>UI Mode disconnected</div>
|
||||
<div><a href='#' onClick={() => window.location.reload()}>Reload the page</a> to reconnect</div>
|
||||
</div>}
|
||||
<SplitView sidebarSize={250} orientation='horizontal' sidebarIsFirst={true}>
|
||||
<SplitView sidebarSize={250} minSidebarSize={125} orientation='horizontal' sidebarIsFirst={true}>
|
||||
<div className='vbox'>
|
||||
<div className={'vbox' + (isShowingOutput ? '' : ' hidden')}>
|
||||
<Toolbar>
|
||||
|
@ -22,6 +22,7 @@ export interface SplitViewProps {
|
||||
sidebarHidden?: boolean,
|
||||
sidebarIsFirst?: boolean,
|
||||
orientation?: 'vertical' | 'horizontal',
|
||||
minSidebarSize?: number,
|
||||
children: JSX.Element | JSX.Element[] | string,
|
||||
}
|
||||
|
||||
@ -32,9 +33,10 @@ export const SplitView: React.FC<SplitViewProps> = ({
|
||||
sidebarHidden = false,
|
||||
sidebarIsFirst = false,
|
||||
orientation = 'vertical',
|
||||
minSidebarSize = kMinSize,
|
||||
children
|
||||
}) => {
|
||||
const [size, setSize] = React.useState<number>(Math.max(kMinSize, sidebarSize));
|
||||
const [size, setSize] = React.useState<number>(Math.max(minSidebarSize, sidebarSize));
|
||||
const [resizing, setResizing] = React.useState<{ offset: number, size: number } | null>(null);
|
||||
|
||||
const childrenArray = React.Children.toArray(children);
|
||||
@ -70,7 +72,7 @@ export const SplitView: React.FC<SplitViewProps> = ({
|
||||
|
||||
const splitView = (event.target as HTMLElement).parentElement!;
|
||||
const rect = splitView.getBoundingClientRect();
|
||||
const size = Math.min(Math.max(kMinSize, newSize), (orientation === 'vertical' ? rect.height : rect.width) - kMinSize);
|
||||
const size = Math.min(Math.max(minSidebarSize, newSize), (orientation === 'vertical' ? rect.height : rect.width) - minSidebarSize);
|
||||
setSize(size);
|
||||
}
|
||||
}}
|
||||
|
Loading…
Reference in New Issue
Block a user