Skip to content

Commit 8bd9aa1

Browse files
authored
Merge pull request #120 from wwayne/custom
Fix custom event with specific id
2 parents f5ed788 + 3732095 commit 8bd9aa1

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/decorators/customEvent.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
const checkStatus = function (dataEventOff, e) {
1010
const {show} = this.state
11+
const {id} = this.props
1112
const dataIsCapture = e.currentTarget.getAttribute('data-iscapture')
1213
const isCapture = dataIsCapture && dataIsCapture === 'true' || this.props.isCapture
1314
const currentItem = e.currentTarget.getAttribute('currentItem')
@@ -17,7 +18,7 @@ const checkStatus = function (dataEventOff, e) {
1718
if (!dataEventOff) this.hideTooltip(e)
1819
} else {
1920
e.currentTarget.setAttribute('currentItem', 'true')
20-
setUntargetItems(e.currentTarget, this.getTargetArray())
21+
setUntargetItems(e.currentTarget, this.getTargetArray(id))
2122
this.showTooltip(e)
2223
}
2324
}

standalone/react-tooltip.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ exports.default = function (target) {
124124

125125
var checkStatus = function checkStatus(dataEventOff, e) {
126126
var show = this.state.show;
127+
var id = this.props.id;
127128

128129
var dataIsCapture = e.currentTarget.getAttribute('data-iscapture');
129130
var isCapture = dataIsCapture && dataIsCapture === 'true' || this.props.isCapture;
@@ -134,7 +135,7 @@ var checkStatus = function checkStatus(dataEventOff, e) {
134135
if (!dataEventOff) this.hideTooltip(e);
135136
} else {
136137
e.currentTarget.setAttribute('currentItem', 'true');
137-
setUntargetItems(e.currentTarget, this.getTargetArray());
138+
setUntargetItems(e.currentTarget, this.getTargetArray(id));
138139
this.showTooltip(e);
139140
}
140141
};

0 commit comments

Comments
 (0)