Misc fixes to Menus
* Disabled prop not forwarded correctly to MenuButton * Active element not set correctly when Menu is opened * Log message had wrong component name
This commit is contained in:
@@ -78,6 +78,7 @@
|
||||
$: propsWeControl = {
|
||||
id,
|
||||
type: resolveButtonType({ type: $$props.type, as }, $buttonStore),
|
||||
disabled: disabled ? true : undefined,
|
||||
"aria-haspopup": true,
|
||||
"aria-controls": $itemsStore?.id,
|
||||
"aria-expanded": disabled ? undefined : $api.menuState === MenuStates.Open,
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
$: data = { disabled, textValue } as MenuItemData;
|
||||
|
||||
onMount(async () => {
|
||||
await tick();
|
||||
$api.registerItem(id, data);
|
||||
});
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
const forwardEvents = forwardEventsBuilder(get_current_component());
|
||||
export let as: SupportedAs = "div";
|
||||
export let use: HTMLActionArray = [];
|
||||
const api = useMenuContext("MenuButton");
|
||||
const api = useMenuContext("MenuItems");
|
||||
const id = `headlessui-menu-items-${useId()}`;
|
||||
let searchDebounce: ReturnType<typeof setTimeout> | null = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user