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

Note for using within a Dialog #2

Open
mjsisley opened this issue May 15, 2023 · 4 comments
Open

Note for using within a Dialog #2

mjsisley opened this issue May 15, 2023 · 4 comments

Comments

@mjsisley
Copy link

Nice component! Shadcn and radix are pretty great and thanks for putting this out there.

As an FYI for using within a Dialog component; in order to make this component functional I had to create a Popover component that wasn't wrapped in a PopoverPrimitive.Portal. When used in the context of within a Dialog - I was unable to interact with anything within the Popover (I was able to focus the Group Items after adding pointer-events-auto - but for reasons I'm not sure on - I could not get focus to the CommandInput except after closing the Edit Dialog).

This is of course a better issue for the shadcn repo (possibly exposing a variant of PopoverContent component); but thought I'd leave a note here in case anyone tries to use your component within a Dialog

Thanks again!

@mxkaske
Copy link
Owner

mxkaske commented May 15, 2023

Thank you for your sharing the advice! Indeed, I encountered some issues nesting the Dialog inside of the Popover and therefore I went for the controlled way.

@adaptive-shield-matrix
Copy link
Contributor

I'm getting some kind of weird transparency bug then using the Multiselect inside a Dialog.
Is this the problem you are talking about or something separate?

Outside of a Dialog it looks/looked completely fine...
The z-Index seems to be wrong too, because the Switch thumb sticks through as well.

2023-06-18--1687058007_

@adaptive-shield-matrix
Copy link
Contributor

nevermind, I cound fix my problem by adding a z-10 class

      <div className="relative mt-2">
        {open && selectables.length > 0 ? (
          <div
            className={cn(
              "absolute w-full z-10 top-0 rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",
            )}
          >

@mxkaske
Copy link
Owner

mxkaske commented Jun 23, 2023

Appreciate the contribution, @adaptive-shield-matrix! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants