You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Event not invoked in ShadowDom's non-root node. #15759
If anyone interested, here is a hack that can resolve problems by event lost due to ShadowRoot.
Full example at mui/material-ui#16223
{// ? Hack for React, let event go through ShadowDomconsthackingEvents=newWeakMap()functionhack(eventName,shadowRoot){shadowRoot.addEventListener(eventName,e=>{if(hackingEvents.has(e))returnconstpath=e.composedPath()vare2=newe.constructor(e.type,e)hackingEvents.set(e2,path)shadowRoot.dispatchEvent(e2)e.stopPropagation()e.stopImmediatePropagation()})}// call hack with parameter1 = Event name you want to make it work with ShadowRoot// parameter2 = the shadow roothack('click',portal)varnativeTarget=Object.getOwnPropertyDescriptor(Event.prototype,'target').getObject.defineProperty(Event.prototype,'target',{get(){if(hackingEvents.has(this))returnhackingEvents.get(this)[0]returnnativeTarget.call(this)}})}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any additional information, please include with in your comment!
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
Activity
Jack-Works commentedon Jun 14, 2019
If anyone interested, here is a hack that can resolve problems by event lost due to ShadowRoot.
Full example at mui/material-ui#16223
stale commentedon Jan 10, 2020
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.
Jack-Works commentedon Jan 10, 2020
Wait. This bug is not fixed yet. Don't close it.
stale commentedon Apr 9, 2020
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any additional information, please include with in your comment!
Jack-Works commentedon Apr 9, 2020
Don't close
stale commentedon Jul 11, 2020
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
Jack-Works commentedon Jul 11, 2020
Bump
stale commentedon Oct 12, 2020
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
Jack-Works commentedon Oct 12, 2020
Let me try if it is fixed in react 17 later
Jack-Works commentedon Oct 12, 2020
resolved in 17.0.0-rc.3