fix: dropdown jumping around

This commit is contained in:
tglide committed 2023-03-29 18:59:41 +01:00
1 parent 2b03d4ee4b
commit ead37d941a
2 files changed
+1 -43

No files matched your search

@@ -84,6 +84,7 @@
value = null;
search = '';
element.value = search;
hasFocus = false;
}
</script>
@@ -87,34 +87,6 @@
whole: formattedColumn
};
}
type Option = {
value: string;
label: string;
name: string;
};
const selectOptions: Option[] = [
{
value: '1',
label: 'first-ec68ac3515e4bc06',
name: 'Option 1'
},
{
value: '2',
label: 'second-ec68ac3521e4bc06',
name: 'Option 2'
}
];
let selectSearch = '';
let selectValue = '';
$: filteredOptions = (function filter() {
return selectOptions.filter((option) =>
option.label.toLowerCase().includes(selectSearch.toLowerCase())
);
})();
</script>
<Container>
@@ -132,21 +104,6 @@
</div>
</div>
<InputSelectSearch
id="related"
label="Related Collection"
bind:search={selectSearch}
bind:value={selectValue}
required
placeholder="Search by ID"
options={filteredOptions}
let:option={o}>
<div class="u-flex u-gap-16">
<span style:color="hsl(var(--color-neutral-70))">{o.label}</span>
{o.name}
</div>
</InputSelectSearch>
{#if $collection?.attributes?.length}
{#if data.documents.total}
<TableScroll isSticky>