Fix input not clearing after adding player character from suggestions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -60,6 +60,7 @@ function AddModeSuggestions({
|
|||||||
onSetQueued,
|
onSetQueued,
|
||||||
onConfirmQueued,
|
onConfirmQueued,
|
||||||
onAddFromPlayerCharacter,
|
onAddFromPlayerCharacter,
|
||||||
|
onClear,
|
||||||
}: {
|
}: {
|
||||||
nameInput: string;
|
nameInput: string;
|
||||||
suggestions: SearchResult[];
|
suggestions: SearchResult[];
|
||||||
@@ -67,6 +68,7 @@ function AddModeSuggestions({
|
|||||||
suggestionIndex: number;
|
suggestionIndex: number;
|
||||||
queued: QueuedCreature | null;
|
queued: QueuedCreature | null;
|
||||||
onDismiss: () => void;
|
onDismiss: () => void;
|
||||||
|
onClear: () => void;
|
||||||
onClickSuggestion: (result: SearchResult) => void;
|
onClickSuggestion: (result: SearchResult) => void;
|
||||||
onSetSuggestionIndex: (i: number) => void;
|
onSetSuggestionIndex: (i: number) => void;
|
||||||
onSetQueued: (q: QueuedCreature | null) => void;
|
onSetQueued: (q: QueuedCreature | null) => void;
|
||||||
@@ -109,7 +111,7 @@ function AddModeSuggestions({
|
|||||||
onMouseDown={(e) => e.preventDefault()}
|
onMouseDown={(e) => e.preventDefault()}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onAddFromPlayerCharacter?.(pc);
|
onAddFromPlayerCharacter?.(pc);
|
||||||
onDismiss();
|
onClear();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{PcIcon && (
|
{PcIcon && (
|
||||||
@@ -525,6 +527,7 @@ export function ActionBar({
|
|||||||
suggestionIndex={suggestionIndex}
|
suggestionIndex={suggestionIndex}
|
||||||
queued={queued}
|
queued={queued}
|
||||||
onDismiss={dismissSuggestions}
|
onDismiss={dismissSuggestions}
|
||||||
|
onClear={clearInput}
|
||||||
onClickSuggestion={handleClickSuggestion}
|
onClickSuggestion={handleClickSuggestion}
|
||||||
onSetSuggestionIndex={setSuggestionIndex}
|
onSetSuggestionIndex={setSuggestionIndex}
|
||||||
onSetQueued={setQueued}
|
onSetQueued={setQueued}
|
||||||
|
|||||||
Reference in New Issue
Block a user