Skip to content

Event not working when the react app is rendered inside the web component issue fix. #17991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

LevinsDurai
Copy link

Hi Team,

Im levins and a big fan of react. I'm facing some css problem while using react in embeddable widget which can be embedded in websites and the same as chrome extension as well. We have often faced CSS overriding issue, hence I have opted to choose shadowDOM to sort this out. Since react events are binding globally, I have faced a problem in accessing react events inside shadowDOM. After digging react repo, I have figured out the getEventTarget() and added the supported changes.

This will be helpful for extending the support for ours and which uses shadowDOM or v8 engine based browsers.
Supported Browsers:
Almost all the Browsers using V8 engine. Even Edge was moving their browsers to V8 engine ( https://www.polymer-project.org/blog/2020-01-15-edge-79-release) .
)
Thanks and regards,
Levins.

Summary

Test Plan

@facebook-github-bot
Copy link

Hi @LevinsDurai! Thank you for your pull request and welcome to our community.

We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 6, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a7fdeff:

Sandbox Source
ecstatic-bash-4grih Configuration

@sizebot
Copy link

sizebot commented Feb 6, 2020

Details of bundled changes.

Comparing: df134d3...a7fdeff

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.profiling.min.js +0.1% +0.1% 123.81 KB 123.9 KB 38.77 KB 38.8 KB NODE_PROFILING
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 3.88 KB 3.88 KB 1.55 KB 1.55 KB UMD_DEV
react-dom-test-utils.development.js 0.0% -0.0% 55.35 KB 55.35 KB 15.58 KB 15.58 KB UMD_DEV
react-dom-testing.profiling.min.js +0.1% +0.1% 121.37 KB 121.45 KB 38.36 KB 38.39 KB NODE_PROFILING
ReactDOMTesting-prod.js 0.0% 🔺+0.1% 340.91 KB 341.07 KB 62.23 KB 62.29 KB FB_WWW_PROD
react-dom-test-utils.production.min.js 0.0% 0.0% 11.21 KB 11.21 KB 4.16 KB 4.16 KB UMD_PROD
ReactDOMTesting-profiling.js 0.0% +0.1% 351.69 KB 351.85 KB 64.18 KB 64.23 KB FB_WWW_PROFILING
react-dom-server.browser.production.min.js 0.0% -0.0% 20.46 KB 20.46 KB 7.5 KB 7.5 KB UMD_PROD
react-dom-test-utils.development.js 0.0% -0.0% 53.62 KB 53.62 KB 15.26 KB 15.26 KB NODE_DEV
react-dom-server.browser.development.js 0.0% -0.0% 135.21 KB 135.21 KB 35.9 KB 35.9 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% -0.0% 10.99 KB 10.99 KB 4.1 KB 4.1 KB NODE_PROD
react-dom-server.browser.production.min.js 0.0% -0.0% 20.39 KB 20.39 KB 7.47 KB 7.47 KB NODE_PROD
react-dom.development.js 0.0% +0.1% 965.09 KB 965.46 KB 217.06 KB 217.17 KB UMD_DEV
react-dom-unstable-native-dependencies.development.js 0.0% -0.0% 60.93 KB 60.93 KB 16.08 KB 16.07 KB UMD_DEV
react-dom.production.min.js 🔺+0.1% 🔺+0.1% 119.94 KB 120.02 KB 38.42 KB 38.45 KB UMD_PROD
react-dom.profiling.min.js +0.1% +0.1% 123.58 KB 123.66 KB 39.57 KB 39.61 KB UMD_PROFILING
react-dom.development.js 0.0% +0.1% 959.17 KB 959.54 KB 215.39 KB 215.51 KB NODE_DEV
react-dom-unstable-native-dependencies.development.js 0.0% -0.0% 60.63 KB 60.63 KB 16 KB 16 KB NODE_DEV
react-dom-unstable-fizz.node.development.js 0.0% -0.1% 4.42 KB 4.42 KB 1.65 KB 1.65 KB NODE_DEV
react-dom.production.min.js 🔺+0.1% 🔺+0.1% 120.03 KB 120.11 KB 37.66 KB 37.7 KB NODE_PROD
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.0% 9.99 KB 9.99 KB 3.38 KB 3.38 KB NODE_PROD
ReactDOMServer-dev.js 0.0% -0.0% 140.33 KB 140.33 KB 35.53 KB 35.52 KB FB_WWW_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% -0.1% 1.21 KB 1.21 KB 697 B 696 B NODE_PROD
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 3.71 KB 3.71 KB 1.5 KB 1.5 KB NODE_DEV
ReactDOM-dev.js 0.0% +0.1% 986.67 KB 987.05 KB 218.19 KB 218.3 KB FB_WWW_DEV
ReactDOM-prod.js 0.0% 🔺+0.1% 393.59 KB 393.75 KB 71.93 KB 71.98 KB FB_WWW_PROD
react-dom-testing.development.js 0.0% +0.1% 962.55 KB 962.93 KB 216.09 KB 216.2 KB UMD_DEV
ReactDOM-profiling.js 0.0% +0.1% 404.84 KB 405 KB 74.09 KB 74.14 KB FB_WWW_PROFILING
react-dom-testing.production.min.js 🔺+0.1% 🔺+0.1% 117.6 KB 117.67 KB 37.9 KB 37.92 KB UMD_PROD
react-dom-testing.profiling.min.js +0.1% 0.0% 121.12 KB 121.2 KB 39.04 KB 39.06 KB UMD_PROFILING
react-dom-testing.development.js 0.0% +0.1% 956.64 KB 957.01 KB 214.4 KB 214.52 KB NODE_DEV
react-dom-server.node.development.js 0.0% -0.0% 136.32 KB 136.32 KB 36.13 KB 36.13 KB NODE_DEV
react-dom-testing.production.min.js 🔺+0.1% 🔺+0.1% 117.69 KB 117.77 KB 37.25 KB 37.28 KB NODE_PROD
ReactDOMTesting-dev.js 0.0% +0.1% 985.24 KB 985.62 KB 217.47 KB 217.59 KB FB_WWW_DEV
react-dom-server.node.production.min.js 0.0% -0.0% 20.79 KB 20.79 KB 7.62 KB 7.62 KB NODE_PROD

Size changes (experimental)

Generated by 🚫 dangerJS against a7fdeff

@sizebot
Copy link

sizebot commented Feb 6, 2020

Details of bundled changes.

Comparing: df134d3...a7fdeff

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.production.min.js 🔺+0.1% 🔺+0.1% 116.03 KB 116.11 KB 37.29 KB 37.31 KB UMD_PROD
react-dom-testing.development.js 0.0% +0.1% 956.61 KB 956.98 KB 214.38 KB 214.51 KB NODE_DEV
react-dom.profiling.min.js +0.1% 0.0% 119.55 KB 119.63 KB 38.45 KB 38.46 KB UMD_PROFILING
react-dom-testing.production.min.js 🔺+0.1% 🔺+0.1% 117.16 KB 117.25 KB 37.11 KB 37.14 KB NODE_PROD
react-dom.development.js 0.0% +0.1% 959.15 KB 959.52 KB 215.37 KB 215.48 KB NODE_DEV
react-dom-testing.profiling.min.js +0.1% +0.1% 120.84 KB 120.92 KB 38.21 KB 38.25 KB NODE_PROFILING
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 3.87 KB 3.87 KB 1.54 KB 1.54 KB UMD_DEV
react-dom.production.min.js 🔺+0.1% 🔺+0.1% 116.09 KB 116.17 KB 36.63 KB 36.66 KB NODE_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.1% 1.2 KB 1.2 KB 702 B 701 B UMD_PROD
react-dom.profiling.min.js +0.1% +0.1% 119.76 KB 119.84 KB 37.74 KB 37.78 KB NODE_PROFILING
react-dom-server.browser.development.js 0.0% 0.0% 139.25 KB 139.25 KB 36.93 KB 36.93 KB UMD_DEV
react-dom-server.browser.production.min.js 0.0% -0.0% 20 KB 20 KB 7.4 KB 7.4 KB UMD_PROD
react-dom-unstable-fizz.browser.development.js 0.0% -0.2% 3.7 KB 3.7 KB 1.5 KB 1.49 KB NODE_DEV
react-dom-server.browser.development.js 0.0% -0.0% 135.19 KB 135.19 KB 35.9 KB 35.9 KB NODE_DEV
react-dom-test-utils.development.js 0.0% -0.0% 55.33 KB 55.33 KB 15.58 KB 15.58 KB UMD_DEV
react-dom-server.browser.production.min.js 0.0% -0.0% 19.93 KB 19.93 KB 7.39 KB 7.39 KB NODE_PROD
react-dom-test-utils.production.min.js 0.0% 0.0% 11.2 KB 11.2 KB 4.16 KB 4.16 KB UMD_PROD
react-dom-unstable-fizz.node.development.js 0.0% -0.2% 4.4 KB 4.4 KB 1.64 KB 1.64 KB NODE_DEV
react-dom-unstable-native-dependencies.development.js 0.0% -0.0% 60.92 KB 60.92 KB 16.07 KB 16.07 KB UMD_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% -0.1% 1.2 KB 1.2 KB 689 B 688 B NODE_PROD
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.0% 10.24 KB 10.24 KB 3.46 KB 3.46 KB UMD_PROD
react-dom-server.node.development.js 0.0% -0.0% 136.3 KB 136.3 KB 36.13 KB 36.13 KB NODE_DEV
react-dom-testing.development.js 0.0% +0.1% 962.53 KB 962.9 KB 216.08 KB 216.19 KB UMD_DEV
react-dom-server.node.production.min.js 0.0% -0.0% 20.34 KB 20.34 KB 7.54 KB 7.54 KB NODE_PROD
react-dom-testing.production.min.js 🔺+0.1% 0.0% 117.06 KB 117.14 KB 37.75 KB 37.77 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js 0.0% -0.0% 60.62 KB 60.62 KB 15.99 KB 15.99 KB NODE_DEV
react-dom.development.js 0.0% +0.1% 965.07 KB 965.44 KB 217.04 KB 217.15 KB UMD_DEV
react-dom-testing.profiling.min.js +0.1% 0.0% 120.59 KB 120.67 KB 38.93 KB 38.94 KB UMD_PROFILING
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.0% 9.98 KB 9.98 KB 3.37 KB 3.37 KB NODE_PROD

ReactDOM: size: 🔺+0.1%, gzip: 🔺+0.1%

Size changes (stable)

Generated by 🚫 dangerJS against a7fdeff

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@LevinsDurai
Copy link
Author

LevinsDurai commented Feb 6, 2020

Here is the workable example app => https://oxbj4.csb.app/

@trueadm
Copy link
Contributor

trueadm commented Feb 10, 2020

The CI is failing, so looks like you might need to run prettier. Also please could you add a test case or at least a Fiddle where this change works compared to before?

Thank you :)

@gaearon
Copy link
Collaborator

gaearon commented Feb 10, 2020

I’m really not sure about this solution. Please see the existing discussion in #12163. How does it address those concerns?

@stale
Copy link

stale bot commented May 15, 2020

This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label May 15, 2020
@stale
Copy link

stale bot commented May 22, 2020

Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you!

@stale stale bot closed this May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Resolution: Stale Automatically closed due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants