fix: selectors keep focus while adding entries
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
proper fix requires keeping `hover` over the whole rowrefactor/sveltekit
parent
79b359854b
commit
0690aef307
|
@ -107,6 +107,7 @@
|
|||
export let emptyOptions: SelectorOption[] | undefined = undefined;
|
||||
export let placeholder = "";
|
||||
export let disabled = false;
|
||||
export let keepFocusOnSet = false;
|
||||
|
||||
export let initial: SelectorValue | undefined = undefined;
|
||||
let inputValue = "";
|
||||
|
@ -335,6 +336,9 @@
|
|||
options = [];
|
||||
optionFocusIndex = -1;
|
||||
hover = false;
|
||||
if (keepFocusOnSet) {
|
||||
focus();
|
||||
}
|
||||
}
|
||||
|
||||
let listEl: HTMLUListElement;
|
||||
|
|
|
@ -394,6 +394,7 @@
|
|||
types={["Attribute", "NewAttribute"]}
|
||||
on:input={(ev) => (newEntryAttribute = ev.detail.name)}
|
||||
on:focus={(ev) => (addFocus = ev.detail)}
|
||||
keepFocusOnSet
|
||||
bind:this={newAttrSelector}
|
||||
/>
|
||||
</div>
|
||||
|
@ -402,6 +403,7 @@
|
|||
<Selector
|
||||
on:input={(ev) => (newEntryValue = ev.detail)}
|
||||
on:focus={(ev) => (addFocus = ev.detail)}
|
||||
keepFocusOnSet
|
||||
/>
|
||||
</div>
|
||||
{:else}
|
||||
|
|
Loading…
Reference in New Issue