@@ -30,24 +30,23 @@ export default function getChildrenDirection(
3030
3131 if ( directionFromParentElement && isValidParentDirection ) {
3232 return directionFromParentElement as ValidPositions ;
33- } else {
34- const [ firstChildElement , secondChildElement , removeClone ] =
35- getChildElements ( parentElement , parentCslpValue ) ;
33+ }
34+ const [ firstChildElement , secondChildElement , removeClone ] =
35+ getChildElements ( parentElement , parentCslpValue ) ;
3636
37- if ( ! firstChildElement ) return "none" ;
37+ if ( ! firstChildElement ) return "none" ;
3838
39- // get horizontal and vertical position differences
40- const firstChildBounds = firstChildElement . getBoundingClientRect ( ) ;
41- const secondChildBounds = secondChildElement . getBoundingClientRect ( ) ;
39+ // get horizontal and vertical position differences
40+ const firstChildBounds = firstChildElement . getBoundingClientRect ( ) ;
41+ const secondChildBounds = secondChildElement . getBoundingClientRect ( ) ;
4242
43- const deltaX = Math . abs ( firstChildBounds . left - secondChildBounds . left ) ;
44- const deltaY = Math . abs ( firstChildBounds . top - secondChildBounds . top ) ;
43+ const deltaX = Math . abs ( firstChildBounds . left - secondChildBounds . left ) ;
44+ const deltaY = Math . abs ( firstChildBounds . top - secondChildBounds . top ) ;
4545
46- const dir = deltaX > deltaY ? "horizontal" : "vertical" ;
46+ const dir = deltaX > deltaY ? "horizontal" : "vertical" ;
4747
48- // remove the clone that was created in case there was only one child
49- removeClone ( ) ;
48+ // remove the clone that was created in case there was only one child
49+ removeClone ( ) ;
5050
51- return dir ;
52- }
51+ return dir ;
5352}
0 commit comments