Skip to content

Commit 359e927

Browse files
author
David Emory
committed
fix(form): Fix error with location field clearing on blur w/ valid location. Addresses conveyal/trim
1 parent f859212 commit 359e927

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/components/form/location-field.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class LocationField extends Component {
147147
// IE does not use relatedTarget, so this check handles cross-browser support.
148148
// see https://stackoverflow.com/a/49325196/915811
149149
const target = e.relatedTarget !== null ? e.relatedTarget : document.activeElement
150-
if (!target || target.getAttribute('role') !== 'menuitem') {
150+
if (!this.props.location && (!target || target.getAttribute('role') !== 'menuitem')) {
151151
this.setState({ menuVisible: false, value: '', geocodedFeatures: [] })
152152
}
153153
}

0 commit comments

Comments
 (0)