Skip to content

Commit

Permalink
fix(clerk-js): Pass defaultOpen prop within org switcher (#4233)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcarpenter authored Sep 26, 2024
1 parent 2dbcd3f commit 99c65f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/cyan-turtles-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clerk/clerk-js": patch
---

Correctly pass `defaultOpen` prop to `OrganizationSwitcher` popover instance.
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { useId } from 'react';

import { AcceptedInvitationsProvider, withCoreUserGuard } from '../../contexts';
import { AcceptedInvitationsProvider, useOrganizationSwitcherContext, withCoreUserGuard } from '../../contexts';
import { Flow } from '../../customizables';
import { Popover, withCardStateProvider, withFloatingTree } from '../../elements';
import { usePopover } from '../../hooks';
import { OrganizationSwitcherPopover } from './OrganizationSwitcherPopover';
import { OrganizationSwitcherTrigger } from './OrganizationSwitcherTrigger';

const _OrganizationSwitcher = withFloatingTree(() => {
const { defaultOpen } = useOrganizationSwitcherContext();
const { floating, reference, styles, toggle, isOpen, nodeId, context } = usePopover({
defaultOpen,
placement: 'bottom-start',
offset: 8,
});
Expand Down

0 comments on commit 99c65f8

Please sign in to comment.