Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Add white border around focused date selection #1270

Benjamin Kingd51e6cb09759
diff --git a/web/js/components/date-selector/input.js b/web/js/components/date-selector/input.js
index 10b6f9ef7..3813e3147 100644
--- a/web/js/components/date-selector/input.js
+++ b/web/js/components/date-selector/input.js
@@ -17,6 +17,7 @@ class DateInputColumn extends React.Component {
super(props);
this.state = {
value: this.props.value,
+ selected: false,
valid: true
};
this.inputs = [];
@@ -210,11 +211,13 @@ class DateInputColumn extends React.Component {
*/
handleFocus(e) {
e.target.select();
+ this.setState({ selected: true });
}
blur() {
this.setState({
value: this.props.value,
- valid: true
+ valid: true,
+ selected: false
});
this.props.blur();
@@ -239,7 +242,11 @@ class DateInputColumn extends React.Component {
render() {
return (
<div
- className={'input-wrapper' + ' input-wrapper-' + this.props.type}
+ className={
+ this.state.selected
+ ? 'input-wrapper selected' + ' input-wrapper-' + this.props.type
+ : 'input-wrapper ' + 'input-wrapper-' + this.props.type
+ }
style={this.state.valid ? {} : { borderColor: '#ff0000' }}
>
<div
@@ -270,7 +277,7 @@ class DateInputColumn extends React.Component {
}
step={this.props.step}
onBlur={this.blur.bind(this)}
- onFocus={this.handleFocus}
+ onFocus={this.handleFocus.bind(this)}
/>
<div
onClick={this.onClickDown.bind(this)}