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

MediaQueryList.addListener has wrong type #851

Open
matthughes opened this issue Jun 25, 2024 · 0 comments
Open

MediaQueryList.addListener has wrong type #851

matthughes opened this issue Jun 25, 2024 · 0 comments

Comments

@matthughes
Copy link

MediaQueryList has an addListener function that takes a non-implementable (js.native) MediaQueryListListener instance. Instead it should take js.Function1[MediaQueryList, Any]

trait MediaQueryList extends js.Object {
  /** Adds a new listener to the media query list. If the specified listener is already in the list, this method has no
    * effect.
    */
  def addListener(listener: MediaQueryListListener): Unit = js.native
}

/** A MediaQueryList object maintains a list of media queries on a document, and handles sending notifications to
  * listeners when the media queries on the document change.
  */
@js.native
trait MediaQueryListListener extends js.Object {
  def apply(mql: MediaQueryList): Unit = js.native
}

This was discussed in Discord here: https://discord.com/channels/632150470000902164/635668814956068864/1255179308021059756

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