diff options
Diffstat (limited to 'src/main/kotlin')
3 files changed, 10 insertions, 5 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/SelectInput.kt b/src/main/kotlin/pl/treksoft/kvision/form/SelectInput.kt index 7ef29754..bd67868d 100644 --- a/src/main/kotlin/pl/treksoft/kvision/form/SelectInput.kt +++ b/src/main/kotlin/pl/treksoft/kvision/form/SelectInput.kt @@ -144,6 +144,7 @@ class SelectInput(options: List<StringPair>? = null, override var value: String? return cl } + @Suppress("ComplexMethod") override fun getSnAttrs(): List<StringPair> { val sn = super.getSnAttrs().toMutableList() name?.let { diff --git a/src/main/kotlin/pl/treksoft/kvision/form/SelectOptGroup.kt b/src/main/kotlin/pl/treksoft/kvision/form/SelectOptGroup.kt index 22483777..41eb951e 100644 --- a/src/main/kotlin/pl/treksoft/kvision/form/SelectOptGroup.kt +++ b/src/main/kotlin/pl/treksoft/kvision/form/SelectOptGroup.kt @@ -57,4 +57,4 @@ class SelectOptGroup(label: String, options: List<StringPair>? = null, maxOption } return sn } -}
\ No newline at end of file +} diff --git a/src/main/kotlin/pl/treksoft/kvision/form/SelectOption.kt b/src/main/kotlin/pl/treksoft/kvision/form/SelectOption.kt index 48412e17..f3be295c 100644 --- a/src/main/kotlin/pl/treksoft/kvision/form/SelectOption.kt +++ b/src/main/kotlin/pl/treksoft/kvision/form/SelectOption.kt @@ -45,15 +45,19 @@ open class SelectOption(value: String? = null, label: String? = null, subtext: S } override fun render(): VNode { - return kvh("option", arrayOf(label ?: value)) + return if (!divider) { + kvh("option", arrayOf(label ?: value)) + } else { + kvh("option") + } } override fun getSnAttrs(): List<StringPair> { val sn = super.getSnAttrs().toMutableList() - value?.let { - sn.add("value" to it) - } if (!divider) { + value?.let { + sn.add("value" to it) + } subtext?.let { sn.add("data-subtext" to it) } |