usgs / earthquake-latest-earthquakes

Mobile friendly, interactive earthquake map and list application.
Other
11 stars 25 forks source link

Problem on deselect in MapView #335

Open emartinez-usgs opened 6 years ago

emartinez-usgs commented 6 years ago

Reported from user email. Could not immediately reproduce. Needs confirmation...

There is a JS bug using the latest Chrome desktop browser (Version 59.0.3071.115 (Official Build) (64-bit)):

Open the map Click on an earthquake in the list Mouse down and drag the map

On mouse up, the following JS

error occurs and the map can no longer be dragged:

index.js:3 Uncaught TypeError: Cannot read property 'length' of null at Object.b.isFilterEnabled (index.js:3) at Object.b.deselectEventonMoveEnd (index.js:3) at Object.b.onMoveEnd (index.js:3) at Object.n (index.js:3) at e.fireEvent (leaflet.js:6) at e._onDragEnd (leaflet.js:8) at e.fireEvent (leaflet.js:6) at e._onUp (leaflet.js:8) at HTMLDocument.s (leaflet.js:8)

This error does not occur with IE or FireFox.

jmfee-usgs commented 6 years ago

I'm unable to reproduce the issue, but based on the stack trace the problem appears to be here in the source: https://github.com/usgs/earthquake-latest-earthquakes/blob/master/src/htdocs/js/map/MapView.js#L288

Not sure when _this.model.get('restrictListToMap') would return null, but that should be checked:

if (filter && filter.length === 0)