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

DOM libs are not in sync with reality. #46061

Closed
lifeiscontent opened this issue Sep 26, 2021 · 2 comments
Closed

DOM libs are not in sync with reality. #46061

lifeiscontent opened this issue Sep 26, 2021 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@lifeiscontent
Copy link

lifeiscontent commented Sep 26, 2021

Bug Report

Typescript doesn't allow to access the constructor of any of the browser's events.

🔎 Search Terms

event
constructor

🕗 Version & Regression Information

I just came across it because I was trying to create a cloned event as seen here:

https://github.com/mui-org/material-ui/blob/master/packages/mui-core/src/SliderUnstyled/SliderUnstyled.js#L246-L254

  • This is a crash
  • This changed between versions ______ and _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

Playground link with relevant code

💻 Code

const evt = new InputEvent('input');

const cloneEvt = new evt.constructor(evt.type, evt); // possible in JS, but is a Type error here.

🙁 Actual behavior

type errors when accessing a constructor of an event object.

🙂 Expected behavior

no type errors when creating a new event from the original event's constructor.

@MartinJohns
Copy link
Contributor

Duplicate of #32452.

@andrewbranch andrewbranch added the Duplicate An existing issue was already created label Sep 30, 2021
@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants