Skip to content

Commit acc2fd9

Browse files
authored
Merge pull request #5319 from WiXSL/fix-removeeventlistener-with-capture
Fix missing capture option in event listener removal
2 parents 0a47f8d + e964e3b commit acc2fd9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/ra-core/src/dataProvider/useRefreshWhenVisible.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ const useRefreshWhenVisible = (delay = 1000 * 60 * 5) => {
3434
return () =>
3535
document.removeEventListener(
3636
'visibilitychange',
37-
handleVisibilityChange
37+
handleVisibilityChange,
38+
{ capture: true }
3839
);
3940
}, [automaticRefreshEnabled, delay, refresh]);
4041
};

0 commit comments

Comments
 (0)