From af5f3f3ed2d60c5d77fd4a04bf7520f0c3408a26 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Fri, 23 Feb 2018 11:06:35 +0100 Subject: Removed DOM artifacts left after destroying DateTimeInput. --- src/main/kotlin/pl/treksoft/kvision/core/Widget.kt | 3 ++- src/main/kotlin/pl/treksoft/kvision/form/time/DateTimeInput.kt | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin') diff --git a/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt b/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt index a746ffa4..8e66d130 100644 --- a/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt +++ b/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt @@ -289,8 +289,9 @@ open class Widget(classes: Set = setOf()) : StyledComponent() { } } destroy = { _ -> - vnode = null afterDestroy() + vnode = null + vnode } } return hooks diff --git a/src/main/kotlin/pl/treksoft/kvision/form/time/DateTimeInput.kt b/src/main/kotlin/pl/treksoft/kvision/form/time/DateTimeInput.kt index 3eeec789..6004b320 100644 --- a/src/main/kotlin/pl/treksoft/kvision/form/time/DateTimeInput.kt +++ b/src/main/kotlin/pl/treksoft/kvision/form/time/DateTimeInput.kt @@ -215,6 +215,10 @@ open class DateTimeInput( } } + override fun afterDestroy() { + getElementJQueryD()?.datetimepicker("remove") + } + private fun initDateTimePicker() { val datePickerFormat = format.toDatePickerFormat() val minView = if (format.contains("HH") || format.contains("mm")) 0 else 2 -- cgit