Skip to content

Setting from / to location via location search on mobile causes a white screen #133

Open
@landonreed

Description

@landonreed

Note: this issue is only detectable on a mobile device (using Chrome dev tools to simulate mobile on a desktop is not enough to trigger).

When a user sets the from and to locations via a geocoded result in the location search component, there is a fitBounds invocation in BaseMap that causes an error to be thrown resulting in a blank white screen.

// If no itinerary update but from/to locations are present, fit to those
} else if (newProps.query.from && newProps.query.to && (fromChanged || toChanged)) {
map.leafletElement.fitBounds([
[newProps.query.from.lat, newProps.query.from.lon],
[newProps.query.to.lat, newProps.query.to.lon]
], { padding })

The error logged in the console suggests an invalid latlng object, but adding a timeout or removing the fitBounds invocation on mobile both appear to be viable solutions. Attempting to set a timeout (with a value of 250 seconds), works, but the map doesn't actually appear to fit to the bounds of the from/to locations. So a better approach may be to just disable the fitBounds call on mobile devices.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions