This commit is contained in:
Philipp Dormann 2025-05-20 14:45:28 +02:00
parent 72e5425c08
commit 77413c7e53
Signed by: philipp
GPG Key ID: 3BB9ADD52DCA4314

View File

@ -168,6 +168,10 @@
document.querySelector("#button_new_donor").focus();
document.querySelector("#button_new_donor").click();
}
if (e.key === "Enter") {
e.preventDefault();
document.querySelector("#zt12c3udy3bme5bqobmqcif1").focus();
}
}}
id="button_existing_donor"
class:bg-indigo-600={!donor_create_new}
@ -187,12 +191,19 @@
document.querySelector("#button_existing_donor").focus();
document.querySelector("#button_existing_donor").click();
}
if (e.key === "Enter") {
e.preventDefault();
document.querySelector("#button_new_donor").click();
}
}}
id="button_new_donor"
class={`py-2 px-4 w-1/2 transition-colors ${donor_create_new ? "bg-indigo-600 text-white" : "bg-gray-100 text-gray-700"}`}
on:click={() => {
donor_create_new = true;
donorinfo = { id: 0, firstname: "", lastname: "" };
setTimeout(() => {
document.querySelector("#firstname").focus();
}, 50);
}}
>
{$_("new-donor")}
@ -218,8 +229,12 @@
inputPlaceholder={$_("search-for-donor")}
noOptionsText={$_("no-donors-found")}
on:onSelected={(data) => {
console.log(data.detail);
if (data.detail !== null) {
document.querySelector("#submit_button").focus();
setTimeout(() => {
document.querySelector("#submit_button").focus();
}, 100);
}
}}
/>
@ -236,6 +251,11 @@
<input
type="text"
id="firstname"
on:keydown={(e) => {
if (e.key === "Enter") {
document.querySelector("#lastname").focus();
}
}}
bind:value={donorinfo.firstname}
class="focus:ring-indigo-500 focus:border-indigo-500 flex-1 block w-full rounded-none rounded-l-md sm:text-sm border-neutral-300 border bg-neutral-50 text-neutral-800 p-2"
placeholder={$_("first-name")}