Skip to content

Commit

Permalink
Focus editor after input file loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
flvndvd committed Dec 22, 2023
1 parent 4c7ac30 commit 0ed8056
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface InputBarContainerProps {
agentConfigurations: AgentConfigurationType[];
disableAttachment: boolean;
onEnterKeyDown: CustomEditorProps["onEnterKeyDown"];
onInputFileChange: (e: React.ChangeEvent) => void;
onInputFileChange: (e: React.ChangeEvent) => Promise<void>;
owner: WorkspaceType;
selectedAssistant: AgentMention | null;
stickyMentions: AgentMention[] | undefined;
Expand Down Expand Up @@ -97,7 +97,10 @@ const InputBarContainer = ({
<div className="flex gap-5 rounded-full border border-structure-100 px-4 py-2 sm:gap-3 sm:px-2">
<input
accept=".txt,.pdf,.md"
onChange={onInputFileChange}
onChange={async (e) => {
await onInputFileChange(e);
editorService.focusEnd();
}}
ref={fileInputRef}
style={{ display: "none" }}
type="file"
Expand Down

0 comments on commit 0ed8056

Please sign in to comment.