Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,10 @@ function ClickAwayListener(props) {
if (event.composedPath) {
insideDOM = event.composedPath().indexOf(nodeRef.current) > -1;
} else {
const doc = ownerDocument(nodeRef.current);
// TODO v6 remove dead logic https://caniuse.com/#search=composedPath.
// `doc.contains` works in modern browsers but isn't supported in IE 11:
Copy link
Contributor

@NMinhNguyen NMinhNguyen Apr 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there's no point mentioning doc.contains at all because this branch will be replaced entirely with event.composedPath in v6, and it's unlikely someone would try to drop documentElement from the code

// https://github.com/timmywil/panzoom/issues/450
// https://github.com/videojs/video.js/pull/5872
const doc = ownerDocument(nodeRef.current);
insideDOM =
!(doc.documentElement && doc.documentElement.contains(event.target)) ||
nodeRef.current.contains(event.target);
!doc.documentElement.contains(event.target) || nodeRef.current.contains(event.target);
}

if (!insideDOM && (disableReactTree || !insideReactTree)) {
Expand Down