Skip to content

Commit

Permalink
Put checkbox/radio components back to the right location in the compo…
Browse files Browse the repository at this point in the history
…nents tree (broken in 5.14.0!)
  • Loading branch information
rjaros committed Jan 31, 2023
1 parent d9d7858 commit 9fcfceb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/main/kotlin/io/kvision/form/check/CheckBox.kt
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,18 @@ open class CheckBox(

private val idc = "kv_form_checkbox_$counter"
final override val input: CheckBoxInput = CheckBoxInput(value).apply {
this.parent = this@CheckBox
this.id = this@CheckBox.idc
this.name = name
}
final override val flabel: FieldLabel = FieldLabelCheck(idc, label, rich, className = "form-check-label") {
this.parent = this@CheckBox
span()
}
final override val invalidFeedback: InvalidFeedback = InvalidFeedback().apply { visible = false }
final override val invalidFeedback: InvalidFeedback = InvalidFeedback().apply {
this.parent = this@CheckBox
visible = false
}

init {
@Suppress("LeakingThis")
Expand Down
7 changes: 6 additions & 1 deletion src/main/kotlin/io/kvision/form/check/Radio.kt
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,19 @@ open class Radio(

private val idc = "kv_form_radio_$counter"
final override val input: RadioInput = RadioInput(value).apply {
this.parent = this@Radio
this.id = this@Radio.idc
this.extraValue = extraValue
this.name = name
}
final override val flabel: FieldLabel = FieldLabelCheck(idc, label, rich, className = "form-check-label") {
this.parent = this@Radio
span()
}
final override val invalidFeedback: InvalidFeedback = InvalidFeedback().apply { visible = false }
final override val invalidFeedback: InvalidFeedback = InvalidFeedback().apply {
this.parent = this@Radio
visible = false
}

init {
@Suppress("LeakingThis")
Expand Down
7 changes: 6 additions & 1 deletion src/main/kotlin/io/kvision/form/check/TriStateCheckBox.kt
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,19 @@ open class TriStateCheckBox(
private val idc = "kv_form_tristatecheckbox_$counter"
final override val input: TriStateCheckBoxInput =
TriStateCheckBoxInput(value ?: false).apply {
this.parent = this@TriStateCheckBox
this.id = this@TriStateCheckBox.idc
this.name = name
this.indeterminate = value == null
}
final override val flabel: FieldLabel = FieldLabelCheck(idc, label, rich, className = "form-check-label") {
this.parent = this@TriStateCheckBox
span()
}
final override val invalidFeedback: InvalidFeedback = InvalidFeedback().apply { visible = false }
final override val invalidFeedback: InvalidFeedback = InvalidFeedback().apply {
this.parent = this@TriStateCheckBox
visible = false
}

init {
@Suppress("LeakingThis")
Expand Down

0 comments on commit 9fcfceb

Please sign in to comment.