link: submit color on blur
@@ -22,6 +22,7 @@ export class SettingsScreen extends Component {
this.changeTitle = this.changeTitle.bind(this);
this.changeDescription = this.changeDescription.bind(this);
this.changeColor = this.changeColor.bind(this);
+ this.submitColor = this.submitColor.bind(this);
this.renderDelete = this.renderDelete.bind(this);
this.renderMetadataSettings = this.renderMetadataSettings.bind(this);
}
@@ -56,8 +57,22 @@ export class SettingsScreen extends Component {
color: `#${uxToHex(this.props.resource.metadata.color || '0x0')}`
});
}
+ }
+
+ changeTitle() {
+ this.setState({title: event.target.value})
+ }
+
+ changeDescription() {
+ this.setState({description: event.target.value});
+ }
- if (state.color !== prevState.color) {
+ changeColor() {
+ this.setState({color: event.target.value});
+ }
+
+ submitColor() {
+ const { props, state } = this;
const { resource } = props;
if (!("metadata" in resource)) {
@@ -91,19 +106,6 @@ export class SettingsScreen extends Component {
}
}
}
- }
-
- changeTitle() {
- this.setState({title: event.target.value})
- }
-
- changeDescription() {
- this.setState({description: event.target.value});
- }
-
- changeColor() {
- this.setState({color: event.target.value});
- }
deleteCollection() {
const { props, state } = this;
@@ -225,6 +227,7 @@ export class SettingsScreen extends Component {
value={this.state.color}
disabled={!props.amOwner}
onChange={this.changeColor}
+ onBlur={this.submitColor}
/>
</div>
</div>
