mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
feat(ComboBox): add a reference to the list HTML element, forward scroll event
This commit is contained in:
parent
8dfa86ee71
commit
0b21a6d3f3
1 changed files with 7 additions and 1 deletions
|
@ -107,6 +107,12 @@
|
||||||
*/
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the list HTML element
|
||||||
|
* @type {null | HTMLElement} [ref=null]
|
||||||
|
*/
|
||||||
|
export let listRef = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {{ id: string; text: string; }} ComboBoxItem
|
* @typedef {{ id: string; text: string; }} ComboBoxItem
|
||||||
*/
|
*/
|
||||||
|
@ -284,7 +290,7 @@
|
||||||
/>
|
/>
|
||||||
</ListBoxField>
|
</ListBoxField>
|
||||||
{#if open}
|
{#if open}
|
||||||
<ListBoxMenu aria-label="{ariaLabel}" id="{id}">
|
<ListBoxMenu aria-label="{ariaLabel}" id="{id}" on:scroll bind:ref={listRef}>
|
||||||
{#each filteredItems as item, i (item.id)}
|
{#each filteredItems as item, i (item.id)}
|
||||||
<ListBoxMenuItem
|
<ListBoxMenuItem
|
||||||
id="{item.id}"
|
id="{item.id}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue