Please select a test fixture.
;
}
diff --git a/fixtures/dom/src/components/fixtures/shadow-dom/index.js b/fixtures/dom/src/components/fixtures/shadow-dom/index.js
new file mode 100644
index 0000000000000..6f9de23656eb1
--- /dev/null
+++ b/fixtures/dom/src/components/fixtures/shadow-dom/index.js
@@ -0,0 +1,67 @@
+import FixtureSet from '../../FixtureSet';
+import TestCase from '../../TestCase';
+
+const SUPPORTS_SHADOW_DOM = 'attachShadow' in HTMLElement.prototype;
+
+const React = window.React;
+const ReactDOM = window.ReactDOM;
+
+class SelectFixture extends React.Component {
+ render() {
+ if (!SUPPORTS_SHADOW_DOM) {
+ return (
+ Browser does not support Shadow DOM, no tests to execute.
+ );
+ }
+
+ return (
+ (this.ref = ref)} />;
+ }
+}
+
+class Box extends React.Component {
+ state = {active: false};
+
+ render() {
+ const style = {
+ height: 100,
+ background: this.state.active ? 'green' : 'orange',
+ color: 'white',
+ marginBottom: 20,
+ };
+ return (
+
this.setState({active: !this.state.active})}
+ style={style}
+ />
+ );
+ }
+}
+
+export default SelectFixture;
diff --git a/packages/react-dom/src/events/getEventTarget.js b/packages/react-dom/src/events/getEventTarget.js
index 76c0052c8520c..b76c2ad29f87a 100644
--- a/packages/react-dom/src/events/getEventTarget.js
+++ b/packages/react-dom/src/events/getEventTarget.js
@@ -17,6 +17,12 @@ import {TEXT_NODE} from '../shared/HTMLNodeType';
function getEventTarget(nativeEvent) {
let target = nativeEvent.target || window;
+ // If composed / inside open shadow-dom use first item of composed path #9242
+ if (nativeEvent.composed && typeof nativeEvent.composedPath === 'function') {
+ const path = nativeEvent.composedPath();
+ target = path[0];
+ }
+
// Normalize SVG