Skip to content

Commit 5ce7ffe

Browse files
committed
Add possible event types hints
1 parent 4e995a1 commit 5ce7ffe

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/decorators/bodyMode.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ export default function (target) {
6464

6565
if (event != null) customEvents[event] = true
6666
if (eventOff != null) customEventsOff[eventOff] = true
67+
for (const event of this.state.possibleCustomEvents) customEvents[event] = true
68+
for (const event of this.state.possibleCustomEventsOff) customEventsOff[event] = true
6769

6870
this.unbindBodyListener(body)
6971

src/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ class ReactTooltip extends Component {
5151
scrollHide: PropTypes.bool,
5252
resizeHide: PropTypes.bool,
5353
wrapper: PropTypes.string,
54-
bodyMode: PropTypes.bool
54+
bodyMode: PropTypes.bool,
55+
possibleCustomEvents: PropTypes.arrayOf(PropTypes.string),
56+
possibleCustomEventsOff: PropTypes.arrayOf(PropTypes.string)
5557
};
5658

5759
static defaultProps = {
@@ -85,7 +87,9 @@ class ReactTooltip extends Component {
8587
currentTarget: null, // Current target of mouse event
8688
ariaProps: parseAria(props), // aria- and role attributes
8789
isEmptyTip: false,
88-
disable: false
90+
disable: false,
91+
possibleCustomEvents: props.possibleCustomEvents || [],
92+
possibleCustomEventsOff: props.possibleCustomEventsOff || []
8993
}
9094

9195
this.bind([

0 commit comments

Comments
 (0)