Rohan Maity
01/24/2022, 7:13 PMobject ModalStyle: StyleSheet() {
val btsModal by style {
keyframes {
from { this.property("top",0.px) }
to { this.property("top", 30.px) }
}
}
}
I added this to my div's style like below, but its not animating
Div(
attrs = {
classes("modal")
id(id)
tabIndex(-1)
attr("aria-labelledby", label)
style {
display(displayState.value)
// background("#0000004d")
position(Position.Relative)
animation(ModalStyle.btsModal) {
duration(10.s)
}
}
}
)
But no animation happensOleksandr Karpovich [JB]
01/25/2022, 5:01 PMobject ModalStyle: StyleSheet() {
val animTransition by keyframes {
from { this.property("top",0.px) }
to { this.property("top", 30.px) }
}
val btsModal by style {
}
}
then in Div
Div(
attrs = {
classes("modal")
id(id)
tabIndex(-1)
attr("aria-labelledby", label)
style {
display(displayState.value)
// background("#0000004d")
position(Position.Relative)
animation(ModalStyle.animTransition) {
duration(10.s)
}
}
}
)
also somewhere at the root you might need to call a composable:
// somewhere like:
renderComposable("root") {
Style(ModalStyle)
}
Rohan Maity
01/25/2022, 6:19 PMRohan Maity
01/25/2022, 6:20 PMby delegate
Rohan Maity
01/28/2022, 7:09 PMhrmlDivElement.addEventListener()
is not available in my project
But when I saw in your project, IDE is able to resolve itRohan Maity
01/28/2022, 7:10 PMhfhbd
01/29/2022, 11:31 AMaddEventListener
is a generated function of EventTarget
, defined in the Kotlin JS web api: org.w3c.dom.events
. Sounds like a missing importRohan Maity
01/29/2022, 11:32 AMunsafeCast
to EventTarget
after that only it worked for me
I checked your project , but there was no such caseRohan Maity
01/29/2022, 11:32 AMBig Chungus
01/29/2022, 11:34 AMhfhbd
01/29/2022, 11:34 AMRohan Maity
01/29/2022, 11:34 AMRohan Maity
01/29/2022, 11:35 AMOr what is the type of the variable?HTMLDivElement
hfhbd
01/29/2022, 11:43 AMval s: HTMLDivElement
s.addEventListener("asf", callback = { f ->
})
Rohan Maity
01/29/2022, 11:43 AMRohan Maity
01/29/2022, 11:43 AMRohan Maity
01/29/2022, 11:44 AMunsafeCast
worked 😐