@@ -5,7 +5,7 @@ import React, { useState, useRef, useImperativeHandle, useEffect } from 'react';
5
5
import ReactDOM from 'react-dom' ;
6
6
7
7
import { 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' ;
9
9
10
10
import { useMaxIndex } from '../../hooks' ;
11
11
import { TTANSITION_DURING_BASE , TTANSITION_DURING_POPUP , WINDOW_SPACE } from '../../utils' ;
@@ -98,12 +98,11 @@ function Sub(props: DSubProps, ref: React.ForwardedRef<() => void>): JSX.Element
98
98
const [ transformOrigin , setTransformOrigin ] = useState < string > ( ) ;
99
99
const updatePosition = useEventCallback ( ( ) => {
100
100
if ( isVisible && ulRef . current && liRef . current ) {
101
- const size = getOriginalSize ( ulRef . current ) ;
102
- const height = size . height ;
101
+ const height = ulRef . current . offsetHeight ;
103
102
104
- let width = size . width ;
103
+ let width = ulRef . current . offsetWidth ;
105
104
if ( inHorizontalNav ) {
106
- width = liRef . current . getBoundingClientRect ( ) . width - 32 ;
105
+ width = liRef . current . offsetWidth - 32 ;
107
106
}
108
107
109
108
const { top, left, transformOrigin } = inHorizontalNav
0 commit comments