From 8af92325f5c0981e7678136a8f12590373ad9e2f Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Sun, 11 Mar 2018 23:45:44 +0100 Subject: Small fix for rich text component. --- src/main/kotlin/pl/treksoft/kvision/form/text/RichTextInput.kt | 6 ++++-- 1 file 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 = 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() }) -- cgit