aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl/treksoft')
-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()