aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2020-02-27 09:22:19 +0100
committerRobert Jaros <rjaros@finn.pl>2020-02-27 09:22:19 +0100
commitbff6c721074bda50e2d5a23d8aa96bf1f939f62a (patch)
treeb997cbb25ebf9787366a9bc9e69314916728a1b0 /src/main/kotlin/pl/treksoft/kvision
parent37bfeeefaa5cf5f30bde50dcb0f1bef7e20409b4 (diff)
downloadkvision-bff6c721074bda50e2d5a23d8aa96bf1f939f62a.tar.gz
kvision-bff6c721074bda50e2d5a23d8aa96bf1f939f62a.tar.bz2
kvision-bff6c721074bda50e2d5a23d8aa96bf1f939f62a.zip
Fix tests
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/core/Widget.kt14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt b/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt
index abff5e37..4dcb62e3 100644
--- a/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt
@@ -358,12 +358,14 @@ open class Widget(classes: Set<String> = setOf()) : StyledComponent(), Component
val handlers = on(eventTarget ?: this)
(handlers::apply)(blockAsWidget)
for (key: String in js("Object").keys(handlers)) {
- val handler = handlers.asDynamic()[key]
- val map = listenersMap[key]
- if (map != null) {
- map[handlerCounter] = handler
- } else {
- listenersMap[key] = mutableMapOf(handlerCounter to handler)
+ if (key != "self") {
+ val handler = handlers.asDynamic()[key]
+ val map = listenersMap[key]
+ if (map != null) {
+ map[handlerCounter] = handler
+ } else {
+ listenersMap[key] = mutableMapOf(handlerCounter to handler)
+ }
}
}
refresh()