diff --git a/frontend/src/actions.js b/frontend/src/actions.js index 4f2cc65..eca588a 100644 --- a/frontend/src/actions.js +++ b/frontend/src/actions.js @@ -1,4 +1,4 @@ -export function input(node, { json } = { json: false }) { +export function input(node, { json, autofocus } = { json: false, autofocus: false }) { const handleInput = () => { if (json) { try { @@ -18,6 +18,10 @@ export function input(node, { json } = { json: false }) { node.addEventListener('focus', handleFocus); node.addEventListener('input', handleInput); + if (autofocus) { + node.focus(); + } + return { destroy: () => { node.removeEventListener('focus', handleFocus); diff --git a/frontend/src/organisms/connection/collection/find.svelte b/frontend/src/organisms/connection/collection/find.svelte index c50812b..db4c777 100644 --- a/frontend/src/organisms/connection/collection/find.svelte +++ b/frontend/src/organisms/connection/collection/find.svelte @@ -1,7 +1,6 @@