Add .file class + Generator user agent

This commit is contained in:
venashial
2022-07-02 22:14:20 -07:00
parent 64ed5fca3b
commit f62723c274
19 changed files with 198 additions and 106 deletions

View File

@@ -11,7 +11,12 @@
export let value = []
export let options: Option[] = []
// Scroll into view selected options when created
let scrollToIndex =
Math.min(...value.map((val) => options.map((it) => it.value).indexOf(val))) || null
const handleChange = (event: any, key: string | number) => {
scrollToIndex = null
if (event.target.checked) {
if (!value) value = []
value = [key, ...value]
@@ -21,7 +26,14 @@
}
</script>
<VirtualList width="100%" {height} itemCount={options.length} itemSize={26}>
<VirtualList
width="100%"
{height}
itemCount={options.length}
itemSize={26}
{scrollToIndex}
scrollToAlignment="center"
scrollToBehaviour="smooth">
<div
slot="item"
let:index