diff --git a/app/src/frontend/building-edit.js b/app/src/frontend/building-edit.js
index f6fc4e50..0b4475a5 100644
--- a/app/src/frontend/building-edit.js
+++ b/app/src/frontend/building-edit.js
@@ -53,6 +53,7 @@ class EditForm extends Component {
this.state.like = this.props.like || undefined;
this.handleChange = this.handleChange.bind(this);
+ this.handleCheck = this.handleCheck.bind(this);
this.handleLike = this.handleLike.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
this.handleUpdate = this.handleUpdate.bind(this);
@@ -73,6 +74,21 @@ class EditForm extends Component {
if (name === 'location_postcode' && value !== null) {
value = value.toUpperCase();
}
+ this.setState({
+ [name]: value
+ });
+ }
+
+ /**
+ * Handle changes on checkboxes
+ * - e.g. input[type=checkbox]
+ *
+ * @param {DocumentEvent} event
+ */
+ handleCheck(event) {
+ const target = event.target;
+ const value = target.checked;
+ const name = target.name;
this.setState({
[name]: value
@@ -208,7 +224,8 @@ class EditForm extends Component {
return
{(props.value)? props.value : 0} likes
diff --git a/app/src/frontend/styles/forms.css b/app/src/frontend/styles/forms.css index 9796cb6d..b3f205b7 100644 --- a/app/src/frontend/styles/forms.css +++ b/app/src/frontend/styles/forms.css @@ -17,6 +17,7 @@ form .alert { } .form-check-input { margin-top: 0.6rem; + left: 0; } label { margin: 0.5em 0 0;