MCPcopy Create free account
hub / github.com/adobe/react-spectrum / onSubmit

Function onSubmit

packages/@react-spectrum/ai/src/PromptField.tsx:178–187  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

176 let {focusWithinProps} = useFocusWithin({onFocusWithinChange: onFocusChange});
177
178 let onSubmit = () => {
179 if (prompt.segments.length === 0) {
180 return;
181 }
182
183 props.onSubmit?.(prompt, attachments);
184 setPrompt(new AutoLinkingSegmentList([]));
185 setAttachments([]);
186 inputRef.current?.focus();
187 };
188
189 return (
190 <PromptFieldContext.Provider

Callers 1

EditableCellInnerFunction · 0.50

Calls 1

focusMethod · 0.80

Tested by

no test coverage detected