@@ -297,6 +297,13 @@ class ReactTooltip extends React.Component {
297
297
scrollHide = this . props . scrollHide
298
298
}
299
299
300
+ // Make sure the correct place is set
301
+ let desiredPlace = e . currentTarget . getAttribute ( 'data-place' ) || this . props . place || 'top'
302
+ let effect = switchToSolid && 'solid' || this . getEffect ( e . currentTarget )
303
+ let offset = e . currentTarget . getAttribute ( 'data-offset' ) || this . props . offset || { }
304
+ let result = getPosition ( e , e . currentTarget , ReactDOM . findDOMNode ( this ) , desiredPlace , desiredPlace , effect , offset )
305
+ let place = result . isNewState ? result . newState . place : desiredPlace
306
+
300
307
// To prevent previously created timers from triggering
301
308
this . clearTimer ( )
302
309
@@ -310,11 +317,11 @@ class ReactTooltip extends React.Component {
310
317
self . setState ( {
311
318
originTooltip : originTooltip ,
312
319
isMultiline : isMultiline ,
313
- desiredPlace : target . getAttribute ( 'data-place' ) || self . props . place || 'top' ,
314
- place : target . getAttribute ( 'data- place' ) || self . props . place || 'top' ,
320
+ desiredPlace : desiredPlace ,
321
+ place : place ,
315
322
type : target . getAttribute ( 'data-type' ) || self . props . type || 'dark' ,
316
- effect : switchToSolid && 'solid' || self . getEffect ( target ) ,
317
- offset : target . getAttribute ( 'data- offset' ) || self . props . offset || { } ,
323
+ effect : effect ,
324
+ offset : offset ,
318
325
html : target . getAttribute ( 'data-html' ) ? target . getAttribute ( 'data-html' ) === 'true' : self . props . html || false ,
319
326
delayShow : target . getAttribute ( 'data-delay-show' ) || self . props . delayShow || 0 ,
320
327
delayHide : target . getAttribute ( 'data-delay-hide' ) || self . props . delayHide || 0 ,
0 commit comments