Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Prevent Keyboard opening when opening prod picker in mobile #1823

Benjamin King5dad6acb8805
diff --git a/web/js/components/layer/product-picker/header.js b/web/js/components/layer/product-picker/header.js
index e74a68807..3b79baca8 100644
--- a/web/js/components/layer/product-picker/header.js
+++ b/web/js/components/layer/product-picker/header.js
@@ -22,9 +22,9 @@ class ProductPickerHeader extends React.Component {
inputValue: props.inputValue
};
}
- componentDidMount(prevProps, prevState) {
+ componentDidMount() {
setTimeout(() => {
- if (this._input) this._input.focus();
+ if (this._input && !this.props.isMobile) this._input.focus();
}, 500);
}
/**
@@ -103,6 +103,7 @@ class ProductPickerHeader extends React.Component {
ProductPickerHeader.propTypes = {
category: PropTypes.object,
inputValue: PropTypes.string,
+ isMobile: PropTypes.bool,
listType: PropTypes.string,
modalView: PropTypes.string,
runSearch: PropTypes.func,
diff --git a/web/js/components/layer/product-picker/product-picker.js b/web/js/components/layer/product-picker/product-picker.js
index e318dd27e..1cb547e19 100644
--- a/web/js/components/layer/product-picker/product-picker.js
+++ b/web/js/components/layer/product-picker/product-picker.js
@@ -139,6 +139,7 @@ class ProductPicker extends React.Component {
modalView,
height,
width,
+ isMobile,
onToggle
} = this.props;
const isCategoryDisplay =
@@ -151,6 +152,7 @@ class ProductPicker extends React.Component {
selectedProjection={selectedProjection}
listType={listType}
inputValue={inputValue}
+ isMobile={isMobile}
category={category}
modalView={modalView}
width={width}
@@ -241,6 +243,7 @@ ProductPicker.propTypes = {
hasMeasurementSetting: PropTypes.func,
hasMeasurementSource: PropTypes.func,
height: PropTypes.number,
+ isMobile: PropTypes.bool,
layerConfig: PropTypes.object,
listType: PropTypes.string,
measurementConfig: PropTypes.object,
@@ -282,6 +285,7 @@ function mapStateToProps(state, ownProps) {
filteredRows: allLayers,
activeLayers,
selectedProjection: proj.id,
+ isMobile: browser.lessThan.medium,
filterProjections: layer => {
return !layer.projections[proj.id];
},