From 6f7435b41e8994821649a50978aeb5b5b65951bd Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Sat, 16 Sep 2017 15:35:51 +0200 Subject: Fixed dropdown tests --- src/main/kotlin/pl/treksoft/kvision/core/Widget.kt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main') diff --git a/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt b/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt index 9c6941b7..aaddbe39 100644 --- a/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt +++ b/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt @@ -115,6 +115,10 @@ open class Widget(classes: Set = setOf()) : KVObject { vnode = v if (ov.elm !== v.elm) afterInsert(v) } + destroy = { _ -> + vnode = null + afterDestroy() + } } return hooks } @@ -175,4 +179,7 @@ open class Widget(classes: Set = setOf()) : KVObject { protected open fun afterInsert(node: VNode) { } + + protected open fun afterDestroy() { + } } -- cgit