fix dialog

This commit is contained in:
Dax Raad
2025-11-02 02:53:55 -05:00
parent bfbcb5f200
commit 28e765ef0a
2 changed files with 11 additions and 18 deletions

View File

@@ -180,7 +180,7 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
focusedTextColor={theme.textMuted} focusedTextColor={theme.textMuted}
ref={(r) => { ref={(r) => {
input = r input = r
input.focus() setTimeout(() => input.focus(), 1)
}} }}
placeholder="Enter search term" placeholder="Enter search term"
/> />

View File

@@ -1,23 +1,18 @@
import { useKeyboard, useRenderer, useTerminalDimensions } from "@opentui/solid" import { useKeyboard, useRenderer, useTerminalDimensions } from "@opentui/solid"
import { batch, createContext, createEffect, Show, useContext, type JSX, type ParentProps } from "solid-js" import {
batch,
createContext,
createEffect,
Show,
useContext,
type JSX,
type ParentProps,
} from "solid-js"
import { useTheme } from "@tui/context/theme" import { useTheme } from "@tui/context/theme"
import { Renderable, RGBA } from "@opentui/core" import { Renderable, RGBA } from "@opentui/core"
import { createStore } from "solid-js/store" import { createStore } from "solid-js/store"
import { createEventBus } from "@solid-primitives/event-bus" import { createEventBus } from "@solid-primitives/event-bus"
const Border = {
topLeft: "┃",
topRight: "┃",
bottomLeft: "┃",
bottomRight: "┃",
horizontal: "",
vertical: "┃",
topT: "+",
bottomT: "+",
leftT: "+",
rightT: "+",
cross: "+",
}
export function Dialog( export function Dialog(
props: ParentProps<{ props: ParentProps<{
size?: "medium" | "large" size?: "medium" | "large"
@@ -45,11 +40,9 @@ export function Dialog(
onMouseUp={async (e) => { onMouseUp={async (e) => {
e.stopPropagation() e.stopPropagation()
}} }}
customBorderChars={Border}
width={props.size === "large" ? 80 : 60} width={props.size === "large" ? 80 : 60}
maxWidth={dimensions().width - 2} maxWidth={dimensions().width - 2}
backgroundColor={theme.backgroundPanel} backgroundColor={theme.backgroundPanel}
borderColor={theme.border}
paddingTop={1} paddingTop={1}
> >
{props.children} {props.children}
@@ -138,7 +131,7 @@ function init() {
}, },
get allClosedEvent() { get allClosedEvent() {
return allClosedEvent return allClosedEvent
} },
} }
} }