feat(webui): Selector chooses first option on unfocus if primitive
This commit is contained in:
parent
91aea2bd17
commit
8a941556cb
1 changed files with 14 additions and 0 deletions
|
@ -312,6 +312,20 @@
|
|||
}
|
||||
}
|
||||
|
||||
$: onFocusChange(inputFocused);
|
||||
|
||||
function onFocusChange(focused: boolean) {
|
||||
if (!focused) {
|
||||
if (
|
||||
options.length &&
|
||||
inputValue &&
|
||||
['String', 'Number', 'Attribute'].includes(options[0].t)
|
||||
) {
|
||||
set(options[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let addressToLabels: { [key: string]: string[] } = {};
|
||||
function onAddressResolved(address: string, ev: CustomEvent<string[]>) {
|
||||
addressToLabels[address] = ev.detail;
|
||||
|
|
Loading…
Reference in a new issue