-
-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Hovercard when using multiple anchors (#3037)
When multiple `HovercardAnchor` elements are used for the same `Hovercard`, a bug occurred in the popover's position because the `anchorElement` was reset each time the popover was mounted. This PR resolves the problem by not depending on the `mounted` state, but instead setting the `disclosureElement` state in a microtask following the display of the popover.
- Loading branch information
Showing
2 changed files
with
31 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@ariakit/react-core": patch | ||
"@ariakit/react": patch | ||
--- | ||
|
||
Fixed [Hovercard](https://ariakit.org/components/hovercard) when used with multiple [`HovercardAnchor`](https://ariakit.org/reference/hovercard-anchor) elements. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62ca059
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
ariakit – ./
ariakit-ariakit.vercel.app
ariakit.org
www.ariakit.org
ariakit-git-main-ariakit.vercel.app