Skip to content

Conversation

piotr-cz
Copy link
Contributor

@piotr-cz piotr-cz commented Apr 8, 2025

This partially reverts #4705 which incorrectly narrowed down types for HTMLMediaElement.controlsList attribute.

The controlsList attribute is a DOMTokenList (space separated list of recommended keywords, like Element.classList), not a single keyword:

...The DOMTokenList takes one or more of three possible values: nodownload, nofullscreen, and noremoteplayback.

Reproduction:

function video() {
  return (
    <video controlsList="nodownload nofullscreen noremoteplayback noplaybackrate" />
  )
}

// error TS2322: Type '"nodownload nofullscreen noremoteplayback noplaybackrate"' is not assignable to type 'Signalish<"nodownload" | "nofullscreen" | "noremoteplayback" | undefined>'.

References:

@piotr-cz piotr-cz changed the title Bugfix: Change HTMLMediaElement.controlslist type to string (DOMTokenList) Bugfix: Change HTMLMediaElement.controlsList type to string (DOMTokenList) Apr 8, 2025
Copy link
Member

@rschristian rschristian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers

@preactjs preactjs deleted a comment from github-actions bot Apr 8, 2025
@rschristian rschristian merged commit bb804cd into preactjs:main Apr 8, 2025
4 checks passed
@piotr-cz piotr-cz deleted the patch-1 branch April 8, 2025 07:36
@JoviDeCroock JoviDeCroock mentioned this pull request May 5, 2025
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 this pull request may close these issues.

2 participants