fix(session): add keyboard support to question dock (#20439)

This commit is contained in:
Shoubhit Dash
2026-04-01 15:47:15 +05:30
committed by GitHub
parent 1df5ad470a
commit 47a676111a
3 changed files with 183 additions and 5 deletions

View File

@@ -7,11 +7,12 @@ export function DockPrompt(props: {
children: JSX.Element
footer: JSX.Element
ref?: (el: HTMLDivElement) => void
onKeyDown?: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent>
}) {
const slot = (name: string) => `${props.kind}-${name}`
return (
<div data-component="dock-prompt" data-kind={props.kind} ref={props.ref}>
<div data-component="dock-prompt" data-kind={props.kind} ref={props.ref} onKeyDown={props.onKeyDown}>
<DockShell data-slot={slot("body")}>
<div data-slot={slot("header")}>{props.header}</div>
<div data-slot={slot("content")}>{props.children}</div>