fix: improve local edit prompt ime input
This commit is contained in:
parent
d066a76f5a
commit
ccb57c095a
@ -2043,7 +2043,7 @@ export function ImageNode({
|
||||
const toolbarRef = useRef<HTMLDivElement>(null);
|
||||
const boxCutoutToolbarRef = useRef<HTMLDivElement>(null);
|
||||
const localEditPromptInputRefs = useRef<
|
||||
Record<string, HTMLInputElement | null>
|
||||
Record<string, HTMLTextAreaElement | null>
|
||||
>({});
|
||||
const localEditPromptDraftRefs = useRef<Record<string, string>>({});
|
||||
const localEditPromptComposingRefs = useRef<Record<string, boolean>>({});
|
||||
@ -7983,9 +7983,9 @@ export function ImageNode({
|
||||
>
|
||||
<div className="flex items-center gap-1.5">
|
||||
{isEditing ? (
|
||||
<input
|
||||
<textarea
|
||||
autoFocus={editingLocalEditRegionId === region.id}
|
||||
className="nodrag nopan nowheel h-9 min-w-0 flex-1 rounded-full border border-slate-300 bg-white/95 px-3 text-[12px] font-medium text-slate-950 caret-slate-950 shadow-[0_10px_24px_rgba(15,23,42,0.14)] outline-none ring-2 ring-transparent transition placeholder:text-slate-400 focus:border-slate-950 focus:ring-slate-950/15 dark:border-white/20 dark:bg-slate-950/88 dark:text-white dark:caret-white dark:placeholder:text-white/42 dark:focus:border-white/40 dark:focus:ring-white/18"
|
||||
className="nodrag nopan nowheel h-9 min-w-0 flex-1 resize-none overflow-hidden rounded-full border border-slate-300 bg-white/95 px-3 py-2 text-[12px] font-medium leading-5 text-slate-950 caret-slate-950 shadow-[0_10px_24px_rgba(15,23,42,0.14)] outline-none ring-2 ring-transparent transition placeholder:text-slate-400 focus:border-slate-950 focus:ring-slate-950/15 dark:border-white/20 dark:bg-slate-950/88 dark:text-white dark:caret-white dark:placeholder:text-white/42 dark:focus:border-white/40 dark:focus:ring-white/18"
|
||||
data-canvas-no-drag="true"
|
||||
data-local-edit-control="true"
|
||||
defaultValue={
|
||||
@ -7993,7 +7993,8 @@ export function ImageNode({
|
||||
region.prompt
|
||||
}
|
||||
autoComplete="off"
|
||||
inputMode="text"
|
||||
enterKeyHint="done"
|
||||
lang="zh-CN"
|
||||
onBlur={(event) => {
|
||||
const nextPrompt = event.currentTarget.value;
|
||||
localEditPromptDraftRefs.current[region.id] =
|
||||
@ -8096,7 +8097,8 @@ export function ImageNode({
|
||||
ref={(input) => {
|
||||
localEditPromptInputRefs.current[region.id] = input;
|
||||
}}
|
||||
type="text"
|
||||
rows={1}
|
||||
spellCheck={false}
|
||||
/>
|
||||
) : (
|
||||
<button
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user