File tree Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -46,18 +46,15 @@ export const VDisk = ({
4646
4747 const anchor = React . useRef ( null ) ;
4848
49- const handleShowPopup = ( ) => {
49+ const debouncedHandleShowPopup = debounce ( ( ) => {
5050 setIsPopupVisible ( true ) ;
5151 onShowPopup ?.( ) ;
52- } ;
52+ } , DEBOUNCE_TIMEOUT ) ;
5353
54- const handleHidePopup = ( ) => {
54+ const debouncedHandleHidePopup = debounce ( ( ) => {
5555 setIsPopupVisible ( false ) ;
5656 onHidePopup ?.( ) ;
57- } ;
58-
59- const debouncedHandleShowPopup = debounce ( handleShowPopup , DEBOUNCE_TIMEOUT ) ;
60- const debouncedHandleHidePopup = debounce ( handleHidePopup , DEBOUNCE_TIMEOUT ) ;
57+ } , DEBOUNCE_TIMEOUT ) ;
6158
6259 let vDiskPath : string | undefined ;
6360
@@ -85,7 +82,10 @@ export const VDisk = ({
8582 className = { b ( ) }
8683 ref = { anchor }
8784 onMouseEnter = { debouncedHandleShowPopup }
88- onMouseLeave = { debouncedHandleHidePopup }
85+ onMouseLeave = { ( ) => {
86+ debouncedHandleShowPopup . cancel ( ) ;
87+ debouncedHandleHidePopup ( ) ;
88+ } }
8989 >
9090 < InternalLink to = { vDiskPath } className = { b ( 'content' ) } >
9191 < DiskStateProgressBar
Original file line number Diff line number Diff line change @@ -51,18 +51,15 @@ export const PDisk = ({
5151 const { NodeId, PDiskId} = data ;
5252 const pDiskIdsDefined = valueIsDefined ( NodeId ) && valueIsDefined ( PDiskId ) ;
5353
54- const handleShowPopup = ( ) => {
54+ const debouncedHandleShowPopup = debounce ( ( ) => {
5555 setIsPopupVisible ( true ) ;
5656 onShowPopup ?.( ) ;
57- } ;
57+ } , DEBOUNCE_TIMEOUT ) ;
5858
59- const handleHidePopup = ( ) => {
59+ const debouncedHandleHidePopup = debounce ( ( ) => {
6060 setIsPopupVisible ( false ) ;
6161 onHidePopup ?.( ) ;
62- } ;
63-
64- const debouncedHandleShowPopup = debounce ( handleShowPopup , DEBOUNCE_TIMEOUT ) ;
65- const debouncedHandleHidePopup = debounce ( handleHidePopup , DEBOUNCE_TIMEOUT ) ;
62+ } , DEBOUNCE_TIMEOUT ) ;
6663
6764 const renderVDisks = ( ) => {
6865 if ( ! vDisks ?. length ) {
@@ -113,7 +110,10 @@ export const PDisk = ({
113110 to = { pDiskPath }
114111 className = { b ( 'content' ) }
115112 onMouseEnter = { debouncedHandleShowPopup }
116- onMouseLeave = { debouncedHandleHidePopup }
113+ onMouseLeave = { ( ) => {
114+ debouncedHandleShowPopup . cancel ( ) ;
115+ debouncedHandleHidePopup ( ) ;
116+ } }
117117 >
118118 < DiskStateProgressBar
119119 diskAllocatedPercent = { data . AllocatedPercent }
You can’t perform that action at this time.
0 commit comments