I use a dropdown component:
<DropdownMenu
isLoading={isLoading}
trigger="Chapters"
triggerType="button"
position="bottom right"
onOpenChange={(event) => console.log(11.1, { event })}
>
<DropdownItemGroup>
{chapterItems.map((item, i) => (
<DropdownItem key={i}>{item.label}</DropdownItem>
))}
</DropdownItemGroup>
</DropdownMenu>
If I click on the button when the menu is closed, there is one onOpenChange event fired. But when it is already open and I click on the trigger button to close it, then the event is fired twice resulting in the menu staying open.
Am I missing something in the code above?
I use this in a confluence custom macro.