From 81ebbc250fbcd4595e41cc3624dd7991fe684dde Mon Sep 17 00:00:00 2001 From: rnentjes Date: Thu, 3 Mar 2022 14:28:13 +0100 Subject: [PATCH] Version 1.0.6 - Fix attr vs property checkbox update --- build.gradle.kts | 2 +- .../kotlin/nl/astraeus/komp/HtmlBuilder.kt | 17 ++--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 1f9e344..b5b5683 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } group = "nl.astraeus" -version = "1.0.5" +version = "1.0.6" repositories { mavenCentral() diff --git a/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt b/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt index 98c5ea8..88668fd 100644 --- a/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt +++ b/src/jsMain/kotlin/nl/astraeus/komp/HtmlBuilder.kt @@ -188,6 +188,7 @@ class HtmlBuilder( if (Komponent.updateMode.isUpdate) { currentElement?.clearKompEvents() + (currentElement as? HTMLInputElement)?.checked = false } currentPosition.lastOrNull()?.setAttr?.clear() @@ -272,21 +273,7 @@ class HtmlBuilder( !setAttrs.contains(attr) && attr != "style" ) { - if (element is HTMLInputElement) { - when (attr) { - "checked" -> { - element.checked = false - } - "value" -> { - element.value = "" - } - else -> { - element.removeAttribute(attr) - } - } - } else { - element.removeAttribute(attr) - } + element.setKompAttribute(attr, null) } } }