Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit b19437f

Browse files
danielkaxisboilund
authored andcommitted
feat(popover): reposition on scroll event
Keep popover at anchor element when user is scrolling
1 parent e57b668 commit b19437f

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

packages/core/src/PopOver/index.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,10 @@ export const PopOver: FC<PopOverProps> = ({
136136
popOverContainer,
137137
])
138138

139-
useOnScrollEffect(
140-
anchorEl,
141-
onScroll !== undefined
142-
? onScroll
143-
: () => {
144-
/** */
145-
}
146-
)
139+
useOnScrollEffect(anchorEl, () => {
140+
onScroll?.()
141+
position()
142+
})
147143

148144
// Used when resizing the parent anchorEl
149145
useOnResizeParentEffect(anchorEl, position)

0 commit comments

Comments
 (0)