mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
21 lines
397 B
Svelte
21 lines
397 B
Svelte
<script>
|
|
import { createEventDispatcher } from "svelte";
|
|
|
|
const dispatch = createEventDispatcher();
|
|
|
|
let searchText;
|
|
|
|
function onKeyUp(e) {
|
|
if (e.keyCode === 13) {
|
|
console.log(`on key up: e.target.keycode`);
|
|
dispatch("enter", { searchText });
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<input
|
|
bind:value="{searchText}"
|
|
placeholder="hit enter to search"
|
|
on:keyup="{onKeyUp}"
|
|
autofocus
|
|
/>
|