mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11: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
|
@ -106,6 +106,12 @@
|
|||
* @type {null | HTMLInputElement} [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
|
||||
|
@ -284,7 +290,7 @@
|
|||
/>
|
||||
</ListBoxField>
|
||||
{#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)}
|
||||
<ListBoxMenuItem
|
||||
id="{item.id}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue