aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt b/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt
index 4ab0a59b..4c3d09a5 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt
@@ -82,8 +82,10 @@ open class RichTextInput(value: String? = null, classes: Set<String> = setOf())
}
this.getElementJQuery()?.on("trix-initialize", { _, _ ->
trixId = this.getElementJQuery()?.attr("trix-id")
- value?.let {
- this.getElement().asDynamic().editor.loadHTML(it)
+ if (trixId!=null) {
+ value?.let {
+ this.getElement().asDynamic().editor.loadHTML(it)
+ }
}
})
this.getElementJQuery()?.on("trix-file-accept", { e, _ -> e.preventDefault() })