Skip to content

Commit f3739a3

Browse files
committed
Change type of possibleCustomEvents property
1 parent db21f21 commit f3739a3

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/decorators/bodyMode.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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([

0 commit comments

Comments
 (0)