@@ -43,7 +43,8 @@ class ReactTooltip extends Component {
4343 countTransform : PropTypes . bool ,
4444 afterShow : PropTypes . func ,
4545 afterHide : PropTypes . func ,
46- disable : PropTypes . bool
46+ disable : PropTypes . bool ,
47+ scrollHide : PropTypes . bool
4748 }
4849
4950 constructor ( props ) {
@@ -231,6 +232,15 @@ class ReactTooltip extends Component {
231232
232233 // If it is focus event or called by ReactTooltip.show, switch to `solid` effect
233234 const switchToSolid = e instanceof window . FocusEvent || isGlobalCall
235+
236+ // if it need to skip adding hide listener to scroll
237+ let scrollHide = true
238+ if ( e . currentTarget . getAttribute ( 'data-scroll-hide' ) ) {
239+ scrollHide = e . currentTarget . getAttribute ( 'data-scroll-hide' ) === 'true'
240+ } else if ( this . props . scrollHide != null ) {
241+ scrollHide = this . props . scrollHide
242+ }
243+
234244 this . setState ( {
235245 placeholder,
236246 place : e . currentTarget . getAttribute ( 'data-place' ) || this . props . place || 'top' ,
@@ -250,7 +260,7 @@ class ReactTooltip extends Component {
250260 ? e . currentTarget . getAttribute ( 'data-count-transform' ) === 'true'
251261 : ( this . props . countTransform != null ? this . props . countTransform : true )
252262 } , ( ) => {
253- this . addScrollListener ( e )
263+ if ( scrollHide ) this . addScrollListener ( e )
254264 this . updateTooltip ( e )
255265
256266 if ( getContent && Array . isArray ( getContent ) ) {
0 commit comments