diff options
Diffstat (limited to 'sw-ui-kt/src')
-rw-r--r-- | sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt | 6 |
1 files changed, 4 insertions, 2 deletions
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 11f52529..a5cb9538 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 @@ -5,6 +5,7 @@ import kotlinx.html.js.onChangeFunction import kotlinx.html.js.onSubmitFunction import org.luxons.sevenwonders.ui.redux.RequestChooseName import org.luxons.sevenwonders.ui.redux.connectDispatch +import org.w3c.dom.HTMLInputElement import react.RBuilder import react.RClass import react.RComponent @@ -31,8 +32,9 @@ private class ChooseNameForm(props: ChooseNameFormProps): RComponent<ChooseNameF input(type = InputType.text) { attrs { value = state.username - onChangeFunction = { - setState(transformState = { ChooseNameFormState(value) }) + onChangeFunction = { e -> + val input = e.currentTarget as HTMLInputElement + setState(transformState = { ChooseNameFormState(input.value) }) } } } |