Fix on submit handler

This commit is contained in:
René Pfeuffer
2019-04-10 16:49:19 +02:00
parent ac2c41f9a1
commit f1bed2f558

View File

@@ -51,19 +51,16 @@ class Page extends React.Component<Props, State> {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { value: "" }; this.state = { value: "" };
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
} }
handleChange(event) { handleChange = event => {
this.setState({ value: event.target.value }); this.setState({ value: event.target.value });
} };
handleSubmit(event) { handleSubmit = event => {
this.props.filter(this.state.value); this.props.filter(this.state.value);
event.preventDefault(); event.preventDefault();
} };
render() { render() {
const { error } = this.props; const { error } = this.props;
@@ -94,11 +91,11 @@ class Page extends React.Component<Props, State> {
"column is-three-fifths is-mobile-action-spacing" "column is-three-fifths is-mobile-action-spacing"
)} )}
> >
<form className={classNames(classes.inputField, "input-field")}> <form
<div className={classNames(classes.inputField, "input-field")}
className="control has-icons-left"
onSubmit={this.handleSubmit} onSubmit={this.handleSubmit}
> >
<div className="control has-icons-left">
<input <input
className={classNames(classes.inputHeight, "input")} className={classNames(classes.inputHeight, "input")}
type="search" type="search"