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
If you have:
Input(type = InputType.DateTimeLocal, attrs = { onInput { val event = it.nativeEvent } })
then onInput will always fail with a ClassCastException, because https://github.com/JetBrains/androidx/blob/107c4ac00bb4c99f29b203d71738ae7cd00c6c75/compose/web/src/jsMain/kotlin/androidx/compose/web/attributes/WrappedEventListener.kt#L150 will always cast it to InputEvent.
onInput
ClassCastException
InputEvent
In Chrome and Safari, the event is type of Event, not InputEvent.
event
Event
Safari: Version 14.1 (16611.1.21.161.6) Chrome: Version 90.0.4430.93 (Offizieller Build) (x86_64) macOS: 11.3.1 (20E241)
Sample Project: https://github.com/hfhbd/ComposeTodo
The text was updated successfully, but these errors were encountered:
Hi @hfhbd, thanks for reporting this issue.
it's possible to workaround this problem:
Input( type = InputType.DateTimeLocal, attrs = { addEventListener("input") { val event = it.nativeEvent // nativeEvent is of type `Event ` } } )
Let me know if this helps.
In general, we want to have accurately typed events. So we'll keep on improving it.
Sorry, something went wrong.
@eymar Thanks, it helped, was to easy to find :) After fixing this, the next button bug appears.
fixed in 0.5.0-build228
eymar
No branches or pull requests
If you have:
then
onInput
will always fail with aClassCastException
, because https://github.com/JetBrains/androidx/blob/107c4ac00bb4c99f29b203d71738ae7cd00c6c75/compose/web/src/jsMain/kotlin/androidx/compose/web/attributes/WrappedEventListener.kt#L150will always cast it to
InputEvent
.In Chrome and Safari, the
event
is type ofEvent
, notInputEvent
.Safari: Version 14.1 (16611.1.21.161.6)
Chrome: Version 90.0.4430.93 (Offizieller Build) (x86_64)
macOS: 11.3.1 (20E241)
Sample Project: https://github.com/hfhbd/ComposeTodo
The text was updated successfully, but these errors were encountered: