1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-26 16:29:37 +02:00

Refactor input and button layout in ActivityComplete component

This commit is contained in:
Sean Morley 2024-09-30 18:16:08 -04:00
parent 6cb31aa125
commit 1eadac90f1
3 changed files with 30 additions and 23 deletions

View file

@ -49,18 +49,21 @@
</script>
<div class="relative">
<input
type="text"
class="input input-bordered w-full"
placeholder="Add an activity"
bind:value={inputVal}
on:keydown={(e) => {
if (e.key === 'Enter') {
e.preventDefault();
addActivity();
}
}}
/>
<div class="flex gap-2">
<input
type="text"
class="input input-bordered w-full"
placeholder="Add an activity"
bind:value={inputVal}
on:keydown={(e) => {
if (e.key === 'Enter') {
e.preventDefault();
addActivity();
}
}}
/>
<button type="button" class="btn btn-neutral" on:click={addActivity}>Add</button>
</div>
{#if inputVal && filteredItems.length > 0}
<ul class="absolute z-10 w-full bg-base-100 shadow-lg max-h-60 overflow-auto">
<!-- svelte-ignore a11y-click-events-have-key-events -->