We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In Scala 2 for an input's onChange I would usually use a type like: slinky.core.SyntheticEvent[org.scalajs.dom.html.Input, org.scalajs.dom.Event]
input
onChange
slinky.core.SyntheticEvent[org.scalajs.dom.html.Input, org.scalajs.dom.Event]
But in Scala 3 Slinky complains that it needs a: slinky.core.SyntheticEvent[slinky.core.TagElement#RefType, org.scalajs.dom.Event]
slinky.core.SyntheticEvent[slinky.core.TagElement#RefType, org.scalajs.dom.Event]
[error] |None of the overloaded alternatives of method := in object onChange with types [error] | (v: Option[() => Unit]): [error] | slinky.core.OptionalAttrPair[slinky.web.html._onChange_attr.type] [error] | (v: () => Unit): slinky.core.AttrPair[slinky.web.html._onChange_attr.type] [error] | [T <: slinky.core.TagElement] [error] | (v: slinky.core.SyntheticEvent[T#RefType, org.scalajs.dom.Event] => Unit): [error] | slinky.core.AttrPair[T] [error] |match arguments ((setFiles : [error] | slinky.core.SyntheticEvent[org.scalajs.dom.html.Input, org.scalajs.dom.Event] [error] | => Unit))
But without referencing html.input you don't get target field.
html.input
target
And I can't think of a workaround at compile time. other than faking it so that I can at least compile to completion:
val onChange = useCallback( (ev: SyntheticEvent[TagElement#RefType, Event]) => { val ev1 = ev.asInstanceOf[slinky.core.SyntheticEvent[html.Input, org.scalajs.dom.Event]] println(s"Do stuff with: ${ev1.target.files}") }, Seq() )
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In Scala 2 for an
input
'sonChange
I would usually use a type like:slinky.core.SyntheticEvent[org.scalajs.dom.html.Input, org.scalajs.dom.Event]
But in Scala 3 Slinky complains that it needs a:
slinky.core.SyntheticEvent[slinky.core.TagElement#RefType, org.scalajs.dom.Event]
But without referencing
html.input
you don't gettarget
field.And I can't think of a workaround at compile time. other than faking it so that I can at least compile to completion:
The text was updated successfully, but these errors were encountered: