File tree 1 file changed +9
-6
lines changed
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 {
581
581
show : true
582
582
} ,
583
583
( ) => {
584
- this . updatePosition ( ) ;
585
- if ( isInvisible && afterShow ) {
586
- afterShow ( e ) ;
587
- }
584
+ this . updatePosition ( ( ) => {
585
+ if ( isInvisible && afterShow ) {
586
+ afterShow ( e ) ;
587
+ }
588
+ } ) ;
588
589
}
589
590
) ;
590
591
}
@@ -692,7 +693,7 @@ class ReactTooltip extends React.Component {
692
693
}
693
694
694
695
// Calculation the position
695
- updatePosition ( ) {
696
+ updatePosition ( callbackAfter ) {
696
697
const {
697
698
currentEvent,
698
699
currentTarget,
@@ -727,10 +728,12 @@ class ReactTooltip extends React.Component {
727
728
if ( result . isNewState ) {
728
729
// Switch to reverse placement
729
730
return this . setState ( result . newState , ( ) => {
730
- this . updatePosition ( ) ;
731
+ this . updatePosition ( callbackAfter ) ;
731
732
} ) ;
732
733
}
733
734
735
+ callbackAfter ( ) ;
736
+
734
737
// Set tooltip position
735
738
node . style . left = result . position . left + 'px' ;
736
739
node . style . top = result . position . top + 'px' ;
You can’t perform that action at this time.
0 commit comments