From c70925ab0de9c51f489d8bffbc2ffcb6cf1dafa0 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 14 Mar 2019 12:29:00 +0000 Subject: [PATCH] Restore `Field` value getter for `RegistrationForm` When working on the `Field` validation support, I thought `RegistrationForm`'s refs would be okay to leave as is, but I missed that they also depended on the value getter. For the moment, it's quicker to temporarily revive the value getter to get registration working. Fixes https://github.com/vector-im/riot-web/issues/9171 --- src/components/views/elements/Field.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/views/elements/Field.js b/src/components/views/elements/Field.js index daf6ec0ce1..84d14802d1 100644 --- a/src/components/views/elements/Field.js +++ b/src/components/views/elements/Field.js @@ -53,6 +53,12 @@ export default class Field extends React.PureComponent { }; } + /* TODO: Remove this once `RegistrationForm` no longer uses refs */ + get value() { + if (!this.refs.fieldInput) return null; + return this.refs.fieldInput.value; + } + onChange = (ev) => { if (this.props.onValidate) { const result = this.props.onValidate(ev.target.value);