Skip to content
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

Uncaught TypeError: EventTarget.dispatchEvent: Argument 1 does not implement interface Event. #62

Open
codermapuche opened this issue Jan 31, 2024 · 0 comments

Comments

@codermapuche
Copy link

window.EventTarget                   = EventTargetShim.EventTarget;
window.Event                             = EventTargetShim.Event;
window.getEventAttributeValue = EventTargetShim.getEventAttributeValue;
window.setEventAttributeValue  = EventTargetShim.setEventAttributeValue;
// ---
const input = document.createElement('input');
input.dispatchEvent(new Event('change', { bubbles: true }));

I do the first part in my site, overriding native with shim for have a homogeneous behavior in all devices.
Most things works as expected, but the second part of code throws
Uncaught TypeError: EventTarget.dispatchEvent: Argument 1 does not implement interface Event.

Maybe EventTargetShim.Event can be a instance of native Event if its is defined for fix this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant