diff options
| author | Robert Jaros <rjaros@finn.pl> | 2019-04-24 20:13:17 +0200 |
|---|---|---|
| committer | Robert Jaros <rjaros@finn.pl> | 2019-04-24 20:13:17 +0200 |
| commit | 833390a649c633892fbc0d9b6e37d6f7913cabb1 (patch) | |
| tree | afe334494ef1ab5265ed53d4f48e6fe389b532ef /src/main/kotlin/pl/treksoft/kvision/form/check | |
| parent | 7bc2dce08659b7cbcb3fd1865c7e3d95e8c42c52 (diff) | |
| download | kvision-833390a649c633892fbc0d9b6e37d6f7913cabb1.tar.gz kvision-833390a649c633892fbc0d9b6e37d6f7913cabb1.tar.bz2 kvision-833390a649c633892fbc0d9b6e37d6f7913cabb1.zip | |
Fix various problems with re-creating DOM nodes.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/form/check')
| -rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/form/check/CheckInput.kt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/check/CheckInput.kt b/src/main/kotlin/pl/treksoft/kvision/form/check/CheckInput.kt index 0184c779..6973efe9 100644 --- a/src/main/kotlin/pl/treksoft/kvision/form/check/CheckInput.kt +++ b/src/main/kotlin/pl/treksoft/kvision/form/check/CheckInput.kt @@ -51,6 +51,7 @@ abstract class CheckInput( ) : Widget(classes), FormInput { init { + this.vnkey = "kv_checkinput_${counter++}" this.setInternalEventListener<CheckInput> { click = { val v = getElementJQuery()?.prop("checked") as Boolean? @@ -129,10 +130,6 @@ abstract class CheckInput( refreshState() } - override fun afterPostpatch(node: VNode) { - refreshState() - } - private fun refreshState() { val v = getElementJQuery()?.prop("checked") as Boolean? if (this.value != v) { @@ -166,4 +163,7 @@ abstract class CheckInput( getElementJQuery()?.blur() } + companion object { + internal var counter = 0 + } } |
