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

HoverCard and Popover are not working with Switch #5072

Closed
dan-iliescu opened this issue Oct 18, 2023 · 2 comments
Closed

HoverCard and Popover are not working with Switch #5072

dan-iliescu opened this issue Oct 18, 2023 · 2 comments

Comments

@dan-iliescu
Copy link

What package has an issue

@mantine/core

Describe the bug

Wrapping the Switch inside the provided demo doesn't work at all, meaning I get no text on hover, but changing from Switch to Button makes it work.

What version of @mantine/* packages do you have in package.json? (Note that all @mantine/* packages must have the same version in order to work correctly)

7

If possible, please include a link to a codesandbox with the reproduced problem

No response

Do you know how to fix the issue

No

Are you willing to participate in fixing this issue and create a pull request with the fix

Yes

Possible fix

No response

@dan-iliescu
Copy link
Author

Only wrapping the Switch inside a div works for HoverCard, but not for Popover.

@rtivital
Copy link
Member

The fix will be available with 7.1.4 release:

export function WithSwitch() {
  return (
    <div style={{ padding: 40 }}>
      <HoverCard width={280} shadow="md">
        <HoverCard.Target refProp="rootRef" eventPropsWrapperName="wrapperProps">
          <Switch label="Switch label" />
        </HoverCard.Target>
        <HoverCard.Dropdown>
          <p>
            Hover card is revealed when user hovers over target element, it will be hidden once
            mouse is not over both target and dropdown elements
          </p>
        </HoverCard.Dropdown>
      </HoverCard>
    </div>
  );
}

rtivital added a commit that referenced this issue Oct 19, 2023
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

2 participants