Skip to content

Commit 2d58f3c

Browse files
committed
fix: fall back to getBoundingClientRect() if getClientRects()[0] is undefined
1 parent 5c00d4e commit 2d58f3c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/common/DatePicker/DatePicker.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ function DatePicker({
126126

127127
const getCoordinates = () => {
128128
if (ref.current) {
129-
const { left, top, height } = ref.current.getClientRects()[0];
129+
const { left, top, height } =
130+
ref.current.getClientRects()[0] ?? ref.current.getBoundingClientRect();
130131
const offsetFromSelectorDisplay = 2;
131132
return {
132133
left,

0 commit comments

Comments
 (0)