aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/form/text
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/form/text')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/text/AbstractTextInput.kt9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/text/AbstractTextInput.kt b/src/main/kotlin/pl/treksoft/kvision/form/text/AbstractTextInput.kt
index 7aa77bdf..5f4a243d 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/text/AbstractTextInput.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/text/AbstractTextInput.kt
@@ -135,9 +135,12 @@ abstract class AbstractTextInput(
* Internal function
*/
protected open fun refreshState() {
- value?.let {
- getElementJQuery()?.`val`(it)
- } ?: getElementJQueryD()?.`val`(null)
+ val v = (getElementJQuery()?.`val`() as? String)
+ if (v != value && !(v.isNullOrEmpty() && value == null)) {
+ value?.let {
+ getElementJQuery()?.`val`(it)
+ } ?: getElementJQueryD()?.`val`(null)
+ }
}
/**