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

fix: glitch on Popover with an hover #2282

Merged
merged 2 commits into from
Sep 26, 2023
Merged

fix: glitch on Popover with an hover #2282

merged 2 commits into from
Sep 26, 2023

Conversation

theo-mesnil
Copy link
Contributor

Fixes #2246

Because of glitch on hover on the Popover due to a hack on our side, we rework this component to have now 2 options:

  • Popover (like today)
  • PopoverHover (it's Hovercard from Ariakit)

We delete the property triggerMethod:

+ import { usePopoverHover, PopoverHover } from '@welcome-ui/popover'

function() {
- const popover = usePopover({ triggerMethod: 'hover' })
+ const popover = usePopoverHover()

  return (
    <>
-    <Popover.Trigger as={Button} store={popover}>
+    <PopoverHover.Trigger as={Button} store={popover}>
        ...
-     </Popover.Trigger>
+     </PopoverHover.Trigger>
-     <Popover store={popover}>
+     <PopoverHover store={popover}>
          ...
-     </Popover>
+     </PopoverHover>
    </>
  )
}
Enregistrement.de.l.ecran.2023-09-20.a.19.27.41.mov

@github-actions
Copy link

👀 Visit Preview

Copy link
Contributor

@mleralec mleralec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So much simpler 👍🏻

packages/Popover/src/Arrow.tsx Outdated Show resolved Hide resolved
packages/Popover/src/Content.tsx Outdated Show resolved Hide resolved
packages/Popover/src/Popover.tsx Outdated Show resolved Hide resolved
packages/Popover/src/PopoverHover.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@RobelTekle RobelTekle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@theo-mesnil theo-mesnil merged commit 72ad5a3 into master Sep 26, 2023
13 checks passed
@theo-mesnil theo-mesnil deleted the fix-popover-hover branch September 26, 2023 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Popover : triggerMethod hover
3 participants