Skip to content

Commit 78caaf9

Browse files
committed
fixes popup glitch when there is not enough width
1 parent a53c077 commit 78caaf9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/hooks/useAlign.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,7 @@ export default function useAlign(
167167
const doc = popupElement.ownerDocument;
168168
const win = getWin(popupElement);
169169

170-
const {
171-
width,
172-
height,
173-
position: popupPosition,
174-
} = win.getComputedStyle(popupElement);
170+
const { position: popupPosition } = win.getComputedStyle(popupElement);
175171

176172
const originLeft = popupElement.style.left;
177173
const originTop = popupElement.style.top;
@@ -222,6 +218,7 @@ export default function useAlign(
222218
};
223219
}
224220
const popupRect = popupElement.getBoundingClientRect();
221+
const { height, width } = win.getComputedStyle(popupElement);
225222
popupRect.x = popupRect.x ?? popupRect.left;
226223
popupRect.y = popupRect.y ?? popupRect.top;
227224
const {

0 commit comments

Comments
 (0)