v. 1.0.1 - Added error handler and default error handling.

Took 1 hour 47 minutes
This commit is contained in:
2022-02-01 12:02:19 +01:00
parent 88625e65a4
commit f82ef1da70
9 changed files with 181 additions and 45 deletions

View File

@@ -152,3 +152,15 @@ internal fun Element.getKompEvents(): MutableMap<String, (Event) -> Unit> {
return this.asDynamic()["komp-events"] ?: mutableMapOf()
}
internal fun Element.findElementIndex(): Int {
val childNodes = parentElement?.children
if (childNodes != null) {
for (index in 0 until childNodes.length) {
if (childNodes[index] == this) {
return index
}
}
}
return 0
}