Skip to content

Bug: onResize media event is missing #21972

Closed
@rileyjshaw

Description

@rileyjshaw

Note: I’m happy to make a pull request to fix this, I just wanted to log it first to ensure there’s interest.


React’s synthetic media events contain several existing media events, for instance onLoadedMetadata and onVolumeChange. But there is no onResize handler.

resize is a standard media event that triggers when one or both of the videoWidth and videoHeight attributes have just been updated. It’s useful for responding to resolution changes in video players.

React version: 17.0.2 (latest release as of initial issue report)

Steps To Reproduce

  1. Create a <video> element with an onResize prop.
  2. Check the console for the following warning:
 Warning: Unknown event handler property `onResize`. It will be ignored.

Link to code example: https://codesandbox.io/s/musing-snowflake-zb0qh?file=/src/App.js

The current behavior

onResize handlers are ignored on <video> elements.

The expected behavior

onResize handlers are valid on <video> elements.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions