diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/SlashPresets/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/SlashPresets/index.jsx
index e7e5536ea2a..d77b0b45fbb 100644
--- a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/SlashPresets/index.jsx
+++ b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/SlashPresets/index.jsx
@@ -8,7 +8,7 @@ import { DotsThree, Plus } from "@phosphor-icons/react";
import showToast from "@/utils/toast";
export const CMD_REGEX = new RegExp(/[^a-zA-Z0-9_-]/g);
-export default function SlashPresets({ setShowing, sendCommand }) {
+export default function SlashPresets({ setShowing, sendCommand, promptRef }) {
const isActiveAgentSession = useIsAgentSessionActive();
const {
isOpen: isAddModalOpen,
@@ -84,6 +84,7 @@ export default function SlashPresets({ setShowing, sendCommand }) {
onClick={() => {
setShowing(false);
sendCommand(`${preset.command} `, false);
+ promptRef?.current?.focus();
}}
className="border-none w-full hover:cursor-pointer hover:bg-theme-action-menu-item-hover px-2 py-2 rounded-xl flex flex-row justify-start"
>
diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/index.jsx
index 5ea0e64ddc9..d0b52bea88e 100644
--- a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/index.jsx
+++ b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/index.jsx
@@ -32,7 +32,7 @@ export default function SlashCommandsButton({ showing, setShowSlashCommand }) {
);
}
-export function SlashCommands({ showing, setShowing, sendCommand }) {
+export function SlashCommands({ showing, setShowing, sendCommand, promptRef }) {
const cmdRef = useRef(null);
useEffect(() => {
function listenForOutsideClick() {
@@ -58,7 +58,11 @@ export function SlashCommands({ showing, setShowing, sendCommand }) {
>
-
+
diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx
index f4711c4ab9c..d490a794b1b 100644
--- a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx
+++ b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx
@@ -237,6 +237,7 @@ export default function PromptInput({
showing={showSlashCommand}
setShowing={setShowSlashCommand}
sendCommand={sendCommand}
+ promptRef={textareaRef}
/>