diff options
author | Robert Jaros <rjaros@finn.pl> | 2020-02-27 09:22:19 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2020-02-27 09:22:19 +0100 |
commit | bff6c721074bda50e2d5a23d8aa96bf1f939f62a (patch) | |
tree | b997cbb25ebf9787366a9bc9e69314916728a1b0 /src/main/kotlin/pl/treksoft | |
parent | 37bfeeefaa5cf5f30bde50dcb0f1bef7e20409b4 (diff) | |
download | kvision-bff6c721074bda50e2d5a23d8aa96bf1f939f62a.tar.gz kvision-bff6c721074bda50e2d5a23d8aa96bf1f939f62a.tar.bz2 kvision-bff6c721074bda50e2d5a23d8aa96bf1f939f62a.zip |
Fix tests
Diffstat (limited to 'src/main/kotlin/pl/treksoft')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/core/Widget.kt | 14 |
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() |