We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8a20794 + 2621f5e commit a030f50Copy full SHA for a030f50
src/index.js
@@ -150,7 +150,8 @@ class ReactTooltip extends Component {
150
if (!id) {
151
targetArray = document.querySelectorAll('[data-tip]:not([data-for])')
152
} else {
153
- targetArray = document.querySelectorAll(`[data-tip][data-for="${id}"]`)
+ const escaped = id.replace(/\\/g, '\\\\').replace(/"/g, '\\"')
154
+ targetArray = document.querySelectorAll(`[data-tip][data-for="${escaped}"]`)
155
}
156
// targetArray is a NodeList, convert it to a real array
157
return nodeListToArray(targetArray)
0 commit comments