@@ -5,7 +5,7 @@ import React, { useState, useRef, useImperativeHandle, useEffect } from 'react';
55import ReactDOM from 'react-dom' ;
66
77import { useEventCallback , useRefExtra } from '@react-devui/hooks' ;
8- import { checkNodeExist , getClassName , getHorizontalSidePosition , getOriginalSize , getVerticalSidePosition } from '@react-devui/utils' ;
8+ import { checkNodeExist , getClassName , getHorizontalSidePosition , getVerticalSidePosition } from '@react-devui/utils' ;
99
1010import { useMaxIndex } from '../../hooks' ;
1111import { TTANSITION_DURING_BASE , TTANSITION_DURING_POPUP , WINDOW_SPACE } from '../../utils' ;
@@ -98,12 +98,11 @@ function Sub(props: DSubProps, ref: React.ForwardedRef<() => void>): JSX.Element
9898 const [ transformOrigin , setTransformOrigin ] = useState < string > ( ) ;
9999 const updatePosition = useEventCallback ( ( ) => {
100100 if ( isVisible && ulRef . current && liRef . current ) {
101- const size = getOriginalSize ( ulRef . current ) ;
102- const height = size . height ;
101+ const height = ulRef . current . offsetHeight ;
103102
104- let width = size . width ;
103+ let width = ulRef . current . offsetWidth ;
105104 if ( inHorizontalNav ) {
106- width = liRef . current . getBoundingClientRect ( ) . width - 32 ;
105+ width = liRef . current . offsetWidth - 32 ;
107106 }
108107
109108 const { top, left, transformOrigin } = inHorizontalNav
0 commit comments