File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -59,16 +59,17 @@ export default function (target) {
5959
6060 target . prototype . bindBodyListener = function ( targetArray ) {
6161 const { id } = this . props
62- const { event, eventOff } = this . state
62+ const { event, eventOff, possibleCustomEvents,
63+ possibleCustomEventsOff } = this . state
6364 const body = getBody ( )
6465
6566 const customEvents = findCustomEvents ( targetArray , 'data-event' )
6667 const customEventsOff = findCustomEvents ( targetArray , 'data-event-off' )
6768
6869 if ( event != null ) customEvents [ event ] = true
6970 if ( eventOff != null ) customEventsOff [ eventOff ] = true
70- for ( const event of this . state . possibleCustomEvents ) customEvents [ event ] = true
71- for ( const event of this . state . possibleCustomEventsOff ) customEventsOff [ event ] = true
71+ possibleCustomEvents . split ( ' ' ) . forEach ( event => customEvents [ event ] = true )
72+ possibleCustomEventsOff . split ( ' ' ) . forEach ( event => customEventsOff [ event ] = true )
7273
7374 this . unbindBodyListener ( body )
7475
Original file line number Diff line number Diff line change @@ -52,8 +52,8 @@ class ReactTooltip extends Component {
5252 resizeHide : PropTypes . bool ,
5353 wrapper : PropTypes . string ,
5454 bodyMode : PropTypes . bool ,
55- possibleCustomEvents : PropTypes . arrayOf ( PropTypes . string ) ,
56- possibleCustomEventsOff : PropTypes . arrayOf ( PropTypes . string )
55+ possibleCustomEvents : PropTypes . string ,
56+ possibleCustomEventsOff : PropTypes . string
5757 } ;
5858
5959 static defaultProps = {
@@ -88,8 +88,8 @@ class ReactTooltip extends Component {
8888 ariaProps : parseAria ( props ) , // aria- and role attributes
8989 isEmptyTip : false ,
9090 disable : false ,
91- possibleCustomEvents : props . possibleCustomEvents || [ ] ,
92- possibleCustomEventsOff : props . possibleCustomEventsOff || [ ]
91+ possibleCustomEvents : props . possibleCustomEvents || '' ,
92+ possibleCustomEventsOff : props . possibleCustomEventsOff || ''
9393 }
9494
9595 this . bind ( [
You can’t perform that action at this time.
0 commit comments