File tree Expand file tree Collapse file tree 1 file changed +18
-9
lines changed
packages/@interactjs/utils Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -213,16 +213,25 @@ export function getElementClientRect (element: Element): Required<Rect> {
213213 const clientRect =
214214 element instanceof domObjects . SVGElement ? element . getBoundingClientRect ( ) : element . getClientRects ( ) [ 0 ]
215215
216- return (
217- clientRect && {
218- left : clientRect . left ,
219- right : clientRect . right ,
220- top : clientRect . top ,
221- bottom : clientRect . bottom ,
222- width : clientRect . width || clientRect . right - clientRect . left ,
223- height : clientRect . height || clientRect . bottom - clientRect . top ,
216+ if ( clientRect ) {
217+ return {
218+ left : clientRect . left ,
219+ right : clientRect . right ,
220+ top : clientRect . top ,
221+ bottom : clientRect . bottom ,
222+ width : clientRect . width || clientRect . right - clientRect . left ,
223+ height : clientRect . height || clientRect . bottom - clientRect . top ,
224+ } ;
224225 }
225- )
226+
227+ return {
228+ left : 0 ,
229+ right : 0 ,
230+ top : 0 ,
231+ bottom : 0 ,
232+ width : 0 ,
233+ height : 0 ,
234+ } ;
226235}
227236
228237export function getElementRect ( element : Element ) {
You can’t perform that action at this time.
0 commit comments