Skip to content

Commit

Permalink
chore: fix TypeError: popover.hide is not a function on close Popover (
Browse files Browse the repository at this point in the history
  • Loading branch information
yyanwang authored Oct 23, 2023
1 parent 35263df commit bacaa4b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/perfect-mayflies-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/design-system': patch
---

fix TypeError: popover.hide is not a function on close Popover
6 changes: 5 additions & 1 deletion packages/design-system/src/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ export function Popover({
fill={tokens.coralColorNeutralBackground}
/>
{typeof children === 'function'
? children({ ...popover.getFloatingProps(), setOpen: popover.setOpen })
? children({
...popover.getFloatingProps(),
setOpen: popover.setOpen,
hide: () => popover.setOpen(false),
})
: children}
</div>
</Wrapper>
Expand Down

0 comments on commit bacaa4b

Please sign in to comment.