Skip to content

Commit 5ad8a9c

Browse files
committed
(Input) Fix validation error for spinner and radio buttons #121
1 parent e4afba9 commit 5ad8a9c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

input/src/main/java/com/maxkeppeler/sheets/input/type/InputRadioButtons.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class InputRadioButtons(key: String? = null, func: InputRadioButtons.() -> Unit)
6767
override fun invokeResultListener() =
6868
resultListener?.invoke(value ?: -1)
6969

70-
override fun valid(): Boolean = value != -1
70+
override fun valid(): Boolean = value != -1 && value != null
7171

7272
override fun putValue(bundle: Bundle, index: Int) {
7373
value?.let { bundle.putInt(getKeyOrIndex(index), it) }

input/src/main/java/com/maxkeppeler/sheets/input/type/spinner/InputSpinner.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class InputSpinner(key: String? = null, func: InputSpinner.() -> Unit) : Input(k
9797
override fun invokeResultListener() =
9898
value?.let { resultListener?.invoke(it) }
9999

100-
override fun valid(): Boolean = value != -1
100+
override fun valid(): Boolean = value != -1 && value != null
101101

102102
override fun putValue(bundle: Bundle, index: Int) {
103103
value?.let { bundle.putInt(getKeyOrIndex(index), it) }

0 commit comments

Comments
 (0)