From b8a047a2883bd604c2225b6e08ad81e5f98784e4 Mon Sep 17 00:00:00 2001 From: joffrey-bion Date: Wed, 23 Oct 2019 02:13:33 +0200 Subject: WIP name form fix --- .../org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sw-ui-kt/src/main/kotlin/org') diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt index 30a0883a..11f52529 100644 --- a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt +++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt @@ -16,10 +16,14 @@ private interface ChooseNameFormProps: RProps { var chooseUsername: (String) -> Unit } -private data class ChooseNameFormState(val username: String): RState +private data class ChooseNameFormState(var username: String = ""): RState private class ChooseNameForm(props: ChooseNameFormProps): RComponent(props) { + override fun ChooseNameFormState.init(props: ChooseNameFormProps) { + username = "" + } + override fun RBuilder.render() { form { attrs.onSubmitFunction = { props.chooseUsername(state.username) } -- cgit