Skip to content

Commit 0559fde

Browse files
committed
refactor: allow clearing popover refs when node is null
1 parent 108a6a1 commit 0559fde

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/@primereact/headless/src/popover/usePopover.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const usePopover = withHeadless({
6969
const setPositionerRef = React.useCallback((node: HTMLDivElement | null) => {
7070
const element = (toElement(node) ?? null) as HTMLDivElement | null;
7171

72-
if (!element || element === positionerRef.current) return;
72+
if (element === positionerRef.current) return;
7373

7474
positionerRef.current = element;
7575
setPositionerElement(element);
@@ -78,7 +78,7 @@ export const usePopover = withHeadless({
7878
const setPopupRef = React.useCallback((node: HTMLElement | null) => {
7979
const element = toElement(node) ?? null;
8080

81-
if (!element || element === popupRef.current) return;
81+
if (element === popupRef.current) return;
8282

8383
popupRef.current = element;
8484
focusTrap.containerRef.current = element;
@@ -88,7 +88,7 @@ export const usePopover = withHeadless({
8888
const setArrowRef = React.useCallback((node: HTMLDivElement | null) => {
8989
const element = (toElement(node) ?? null) as HTMLDivElement | null;
9090

91-
if (!element || element === arrowRef.current) return;
91+
if (element === arrowRef.current) return;
9292

9393
arrowRef.current = element;
9494
setArrowElement(element);

0 commit comments

Comments
 (0)