diff options
author | joffrey-bion <joffrey.bion@gmail.com> | 2020-01-05 18:20:26 +0100 |
---|---|---|
committer | joffrey-bion <joffrey.bion@gmail.com> | 2020-01-05 18:20:26 +0100 |
commit | 08eeaf0fd324b11e291a585f239603c3ee7e655e (patch) | |
tree | 47bb119e81e1406144f20989476e92142a020b32 /sw-ui-kt/src | |
parent | Replace all configuration by useCommonJs() (diff) | |
download | seven-wonders-08eeaf0fd324b11e291a585f239603c3ee7e655e.tar.gz seven-wonders-08eeaf0fd324b11e291a585f239603c3ee7e655e.tar.bz2 seven-wonders-08eeaf0fd324b11e291a585f239603c3ee7e655e.zip |
WIP ChooseNameForm fix
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) }) } } } |