Skip to content

Commit

Permalink
Restore Field value getter for RegistrationForm
Browse files Browse the repository at this point in the history
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 element-hq/element-web#9171
  • Loading branch information
jryans committed Mar 14, 2019
1 parent 45063ca commit c70925a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/views/elements/Field.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c70925a

Please sign in to comment.