wip
This commit is contained in:
parent
72e5425c08
commit
77413c7e53
@ -168,6 +168,10 @@
|
|||||||
document.querySelector("#button_new_donor").focus();
|
document.querySelector("#button_new_donor").focus();
|
||||||
document.querySelector("#button_new_donor").click();
|
document.querySelector("#button_new_donor").click();
|
||||||
}
|
}
|
||||||
|
if (e.key === "Enter") {
|
||||||
|
e.preventDefault();
|
||||||
|
document.querySelector("#zt12c3udy3bme5bqobmqcif1").focus();
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
id="button_existing_donor"
|
id="button_existing_donor"
|
||||||
class:bg-indigo-600={!donor_create_new}
|
class:bg-indigo-600={!donor_create_new}
|
||||||
@ -187,12 +191,19 @@
|
|||||||
document.querySelector("#button_existing_donor").focus();
|
document.querySelector("#button_existing_donor").focus();
|
||||||
document.querySelector("#button_existing_donor").click();
|
document.querySelector("#button_existing_donor").click();
|
||||||
}
|
}
|
||||||
|
if (e.key === "Enter") {
|
||||||
|
e.preventDefault();
|
||||||
|
document.querySelector("#button_new_donor").click();
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
id="button_new_donor"
|
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"}`}
|
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={() => {
|
on:click={() => {
|
||||||
donor_create_new = true;
|
donor_create_new = true;
|
||||||
donorinfo = { id: 0, firstname: "", lastname: "" };
|
donorinfo = { id: 0, firstname: "", lastname: "" };
|
||||||
|
setTimeout(() => {
|
||||||
|
document.querySelector("#firstname").focus();
|
||||||
|
}, 50);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{$_("new-donor")}
|
{$_("new-donor")}
|
||||||
@ -218,8 +229,12 @@
|
|||||||
inputPlaceholder={$_("search-for-donor")}
|
inputPlaceholder={$_("search-for-donor")}
|
||||||
noOptionsText={$_("no-donors-found")}
|
noOptionsText={$_("no-donors-found")}
|
||||||
on:onSelected={(data) => {
|
on:onSelected={(data) => {
|
||||||
|
console.log(data.detail);
|
||||||
if (data.detail !== null) {
|
if (data.detail !== null) {
|
||||||
document.querySelector("#submit_button").focus();
|
document.querySelector("#submit_button").focus();
|
||||||
|
setTimeout(() => {
|
||||||
|
document.querySelector("#submit_button").focus();
|
||||||
|
}, 100);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@ -236,6 +251,11 @@
|
|||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="firstname"
|
id="firstname"
|
||||||
|
on:keydown={(e) => {
|
||||||
|
if (e.key === "Enter") {
|
||||||
|
document.querySelector("#lastname").focus();
|
||||||
|
}
|
||||||
|
}}
|
||||||
bind:value={donorinfo.firstname}
|
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"
|
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")}
|
placeholder={$_("first-name")}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user