Handle dynamically adding items in list components: Radio Group, Tabs, Listbox, Menu
Fixes #29 Upstream Headless UI handles this for Radio Group but not for the others. I didn't see any reason why not to implement this for the other ones too.
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
export let use: HTMLActionArray = [];
|
||||
|
||||
let api = useTabsContext("TabList");
|
||||
let listRef = $api.listRef;
|
||||
|
||||
$: propsWeControl = {
|
||||
role: "tablist",
|
||||
"aria-orientation": $api.orientation,
|
||||
@@ -23,6 +25,7 @@
|
||||
{...{ ...$$restProps, ...propsWeControl }}
|
||||
{as}
|
||||
{slotProps}
|
||||
bind:el={$listRef}
|
||||
use={[...use, forwardEvents]}
|
||||
name={"TabList"}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user