Skip to content

Commit 495d279

Browse files
dmydrywuweiweiwu
authored andcommitted
Add an extra check for an e.target.className.indexOf function (bvaughn#1210)
* check if an e.target has a className with an indexOf function * Delete detectElementResize_20180906173208.js sorry, forgot to add vscode .history to .gitignore * Delete detectElementResize_20180906173856.js sorry, forgot to add vscode .history to .gitignore
1 parent 1762cee commit 495d279

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

source/vendor/detectElementResize.js

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ export default function createDetectElementResize(nonce) {
7171
var scrollListener = function(e) {
7272
// Don't measure (which forces) reflow for scrolls that happen inside of children!
7373
if (
74+
e.target.className &&
75+
typeof e.target.className.indexOf === 'function' &&
7476
e.target.className.indexOf('contract-trigger') < 0 &&
7577
e.target.className.indexOf('expand-trigger') < 0
7678
) {

0 commit comments

Comments
 (0)