Skip to content

Commit c584da9

Browse files
committed
fix(location): clarify index null check
1 parent 346672d commit c584da9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/components/form/location-field.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ class LocationField extends Component {
179179

180180
// 'Enter' keypress serves two purposes:
181181
// - If pressed when typing in search string, switch from 'autocomplete'
182-
// to 'search' geocosing
182+
// to 'search' geocoding
183183
// - If pressed when dropdown results menu is active, apply the location
184184
// associated with current selected menu item
185185
case 'Enter':
186-
if (activeIndex) { // Menu is active
186+
if (typeof activeIndex === 'number') { // Menu is active
187187
// Retrieve location selection handler from lookup object and invoke
188188
const locationSelected = this.locationSelectedLookup[activeIndex]
189189
if (locationSelected) locationSelected()

0 commit comments

Comments
 (0)