Fix resizable pannel doing its job badly
This commit is contained in:
parent
cb9aa57e64
commit
d2c61771e2
2 changed files with 5 additions and 4 deletions
|
@ -16,6 +16,7 @@ export function App() {
|
||||||
const [updating, setUpdating] = createSignal(true)
|
const [updating, setUpdating] = createSignal(true)
|
||||||
const [showSettings, setShowSettings] = createSignal(false)
|
const [showSettings, setShowSettings] = createSignal(false)
|
||||||
const [settingsTab, setSettingsTab] = createSignal<SettingsTab>('accounts')
|
const [settingsTab, setSettingsTab] = createSignal<SettingsTab>('accounts')
|
||||||
|
const [isResizing, setIsResizing] = createSignal(false)
|
||||||
|
|
||||||
let workerIframe!: HTMLIFrameElement
|
let workerIframe!: HTMLIFrameElement
|
||||||
|
|
||||||
|
@ -65,12 +66,12 @@ export function App() {
|
||||||
<EditorTabs />
|
<EditorTabs />
|
||||||
<Editor class="size-full" />
|
<Editor class="size-full" />
|
||||||
</ResizablePanel>
|
</ResizablePanel>
|
||||||
<ResizableHandle withHandle />
|
<ResizableHandle withHandle onMouseDown={() => setIsResizing(true)} onMouseUp={() => setIsResizing(false)} />
|
||||||
<ResizablePanel
|
<ResizablePanel
|
||||||
class="flex max-h-full flex-col overflow-hidden"
|
class="flex max-h-full flex-col overflow-hidden"
|
||||||
minSize={0.2}
|
minSize={0.2}
|
||||||
>
|
>
|
||||||
<Runner />
|
<Runner isResizing={isResizing()} />
|
||||||
</ResizablePanel>
|
</ResizablePanel>
|
||||||
</Resizable>
|
</Resizable>
|
||||||
</Show>
|
</Show>
|
||||||
|
|
|
@ -25,7 +25,7 @@ const $enableUpdates = persistentAtom('repl:enableUpdates', true, {
|
||||||
decode: value => value === 'true',
|
decode: value => value === 'true',
|
||||||
})
|
})
|
||||||
|
|
||||||
export function Runner() {
|
export function Runner(props: { isResizing: boolean }) {
|
||||||
const [devtoolsIframe, setDevtoolsIframe] = createSignal<HTMLIFrameElement | undefined>()
|
const [devtoolsIframe, setDevtoolsIframe] = createSignal<HTMLIFrameElement | undefined>()
|
||||||
const [runnerIframe, setRunnerIframe] = createSignal<HTMLIFrameElement>()
|
const [runnerIframe, setRunnerIframe] = createSignal<HTMLIFrameElement>()
|
||||||
const [runnerLoaded, setRunnerLoaded] = createSignal(false)
|
const [runnerLoaded, setRunnerLoaded] = createSignal(false)
|
||||||
|
@ -315,7 +315,7 @@ export function Runner() {
|
||||||
</div>
|
</div>
|
||||||
<div class="h-px shrink-0 bg-border" />
|
<div class="h-px shrink-0 bg-border" />
|
||||||
<Devtools
|
<Devtools
|
||||||
class="size-full grow-0"
|
class={cn('size-full grow-0', props.isResizing && 'pointer-events-none')}
|
||||||
iframeRef={setDevtoolsIframe}
|
iframeRef={setDevtoolsIframe}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|
Loading…
Reference in a new issue