Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: Mobile sidebar doesn't play nice with Clerk popup #5462

Open
2 tasks done
stargeneration-winston opened this issue Oct 20, 2024 · 6 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@stargeneration-winston
Copy link

Describe the bug

image

I place the Clerk signed-in user button on my sidebar, and this button is impossible to click on any screen where the sidebar is an overlay.

CleanShot 2024-10-20 at 01 12 39@2x

This appears to be because the sidebar's interaction area overrides the clerk button.

    <Sidebar variant="floating" collapsible="offcanvas">
      <SidebarHeader>
        <div className="flex justify-between items-center p-4">
          Workspace
          <SignedIn>
            <div className="relative z-1">
              <UserButton
                appearance={{
                  baseTheme: darkMode ? dark : undefined,
                }}
              />
            </div>
          </SignedIn>
        </div>
      </SidebarHeader>

I've tried using tailwind to adjust the relative z but no luck so far.

Affected component/components

Sidebar

How to reproduce

  1. Add Sidebar
  2. Add Clerk signed in button to sidebar.

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

Chrome 129
macOS 15
Vite 5.4.2

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@stargeneration-winston stargeneration-winston added the bug Something isn't working label Oct 20, 2024
@antho1404
Copy link

I found a way to "fix" this issue by adding the following css

.cl-organizationSwitcherPopoverRootBox {
  pointer-events: auto;
}

Also connecting the issue on clerk about that clerk/javascript#4373

@holdenmatt
Copy link

I'm also seeing this. I can click to open the menu, but none of the menu items are clickable.

The CSS workaround doesn't work for me. Any other ideas?

@antho1404
Copy link

Have you tried to put it directly when you initialize the provider with something like that:

<ClerkProvider appearance={{
  elements: {   
    organizationSwitcherPopoverRootBox: {
      width: "100%",
      pointerEvents: "auto",
    },
  },
}}>
  {children}
<ClerkProvider>

@kylesurfs
Copy link

I've been having the same issues as described above. Per @antho1404's comment, I added the following to my <ClerkProvider> and it fixed my issue:

<ClerkProvider
        appearance={{
          elements: {
            organizationSwitcherPopoverRootBox: {
              width: "100%",
              pointerEvents: "auto",
            },
            userButtonPopoverRootBox: {
              width: "100%",
              pointerEvents: "auto",
            },
          },
        }}
      >

@holdenmatt
Copy link

Very nice, that also fixed it for me. I'm not using organizations in Clerk so adding the user button version was the fix for me - thanks!

@lucebert
Copy link

lucebert commented Feb 1, 2025

@kylesurfs works for me thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants