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

Add types definition for resize event on video element. #63061

Closed
pennywisexy opened this issue Nov 3, 2022 · 8 comments · Fixed by #63076
Closed

Add types definition for resize event on video element. #63061

pennywisexy opened this issue Nov 3, 2022 · 8 comments · Fixed by #63076

Comments

@pennywisexy
Copy link

No description provided.

@Semigradsky
Copy link
Contributor

@pennywisexy please provide full information. What the library, what the interface/type?

@pennywisexy
Copy link
Author

@pennywisexy please provide full information. What the library, what the interface/type?

library - @types/react, interface DOMAttributes.

@Semigradsky
Copy link
Contributor

https://developer.mozilla.org/en-US/docs/Web/API/Window/resize_event

In some earlier browsers it was possible to register resize event handlers on any HTML element. It is still possible to set onresize attributes or use addEventListener() to set a handler on any element. However, resize events are only fired on the window object (i.e. returned by document.defaultView). Only handlers registered on the window object will receive resize events.

@pennywisexy so you should subscribe to window resize

@pennywisexy
Copy link
Author

pennywisexy commented Nov 4, 2022

https://developer.mozilla.org/en-US/docs/Web/API/Window/resize_event

In some earlier browsers it was possible to register resize event handlers on any HTML element. It is still possible to set onresize attributes or use addEventListener() to set a handler on any element. However, resize events are only fired on the window object (i.e. returned by document.defaultView). Only handlers registered on the window object will receive resize events.

@pennywisexy so you should subscribe to window resize

I was talking about resize event for the video element (extend HTMLMediaElement). It a small difference of these events. And the resize event for the video is not described in @types/react. It must be added.

@Semigradsky
Copy link
Contributor

Semigradsky commented Nov 4, 2022

@pennywisexy
Copy link
Author

Great!

@mariuslundgard
Copy link

@Semigradsky Hi there, I'm seeing TS errors in my project that sound like they might be introduced after #63076. In this case it's a SVG component with props of type React.SVGProps<SVGSVGElement>:

image

@Semigradsky
Copy link
Contributor

Semigradsky commented Nov 24, 2022

@mariuslundgard Could you provide reproducible example?

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

Successfully merging a pull request may close this issue.

3 participants