Skip to content

Commit

Permalink
Input focus with query selector
Browse files Browse the repository at this point in the history
  • Loading branch information
h00s committed May 4, 2024
1 parent dd5d4ef commit b43be32
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/src/lib/components/Link.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
import { createLink } from '$lib/repositories/links'
import { urlByShortId, urlWithoutProtocol } from '$lib/helpers/link'
import { onMount } from 'svelte'
import { afterNavigate } from '$app/navigation';
import { fade } from 'svelte/transition'
onMount(() => {
displayedOptions = false;
inputUrl.focus();
});
afterNavigate(() => {
const input = document.querySelector('#url');
input.focus();
//inputUrl.focus();
});
async function shortenLink() {
Expand Down

0 comments on commit b43be32

Please sign in to comment.