File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -581,10 +581,11 @@ class ReactTooltip extends React.Component {
581581 show : true
582582 } ,
583583 ( ) => {
584- this . updatePosition ( ) ;
585- if ( isInvisible && afterShow ) {
586- afterShow ( e ) ;
587- }
584+ this . updatePosition ( ( ) => {
585+ if ( isInvisible && afterShow ) {
586+ afterShow ( e ) ;
587+ }
588+ } ) ;
588589 }
589590 ) ;
590591 }
@@ -692,7 +693,7 @@ class ReactTooltip extends React.Component {
692693 }
693694
694695 // Calculation the position
695- updatePosition ( ) {
696+ updatePosition ( callbackAfter ) {
696697 const {
697698 currentEvent,
698699 currentTarget,
@@ -727,10 +728,12 @@ class ReactTooltip extends React.Component {
727728 if ( result . isNewState ) {
728729 // Switch to reverse placement
729730 return this . setState ( result . newState , ( ) => {
730- this . updatePosition ( ) ;
731+ this . updatePosition ( callbackAfter ) ;
731732 } ) ;
732733 }
733734
735+ callbackAfter ( ) ;
736+
734737 // Set tooltip position
735738 node . style . left = result . position . left + 'px' ;
736739 node . style . top = result . position . top + 'px' ;
You can’t perform that action at this time.
0 commit comments