Skip to content

Commit

Permalink
fix: forward child refs to fix regression in #1343 (#1350)
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan authored Jun 14, 2024
1 parent f3a04c1 commit cab318e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sanity/ui",
"version": "2.3.5",
"version": "2.3.6-0",
"keywords": [
"sanity",
"ui",
Expand Down
4 changes: 4 additions & 0 deletions src/core/primitives/tooltip/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ export const Tooltip = forwardRef(function Tooltip(
)

const childRef = useRef<HTMLElement | null>(null)

// Merge refs so that any ref we are overriding is called as well
useImperativeHandle((childProp as any)?.ref, () => childRef.current)

const child = useMemo(() => {
if (!childProp) return null

Expand Down

0 comments on commit cab318e

Please sign in to comment.