fix: snippet running on enter key
This commit is contained in:
@@ -725,6 +725,11 @@ export function SSHToolsSidebar({
|
|||||||
onSnippetExecute(snippet.content);
|
onSnippetExecute(snippet.content);
|
||||||
toast.success(t("snippets.executeSuccess", { name: snippet.name }));
|
toast.success(t("snippets.executeSuccess", { name: snippet.name }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove focus from any active element in the sidebar to prevent accidental re-execution
|
||||||
|
if (document.activeElement instanceof HTMLElement) {
|
||||||
|
document.activeElement.blur();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCopy = (snippet: Snippet) => {
|
const handleCopy = (snippet: Snippet) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user