mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 12:43:11 +10:00
Merge pull request #917 from sharetribe/fix-mobile-touch-default-action
Fix LocationAutocompleteInput's events that cause clicks
This commit is contained in:
commit
a54b1c8b8a
2 changed files with 23 additions and 6 deletions
|
|
@ -11,7 +11,9 @@ way to update this template, but currently, we follow a pattern:
|
|||
* Patch (v0.0.**X**): Bug fixes and small changes to components.
|
||||
|
||||
---
|
||||
## Upcoming version 2018-08-XX
|
||||
## Upcoming version 2018-09-XX
|
||||
* [fix] Touch event from location autocomplete prediction list ended up causing clicks.
|
||||
[#917](https://github.com/sharetribe/flex-template-web/pull/917)
|
||||
* [change] Disable default predictions in listing wizard
|
||||
[#906](https://github.com/sharetribe/flex-template-web/pull/906)
|
||||
|
||||
|
|
|
|||
|
|
@ -64,11 +64,26 @@ const LocationPredictionsList = props => {
|
|||
<li
|
||||
className={isHighlighted ? css.highlighted : null}
|
||||
key={predictionId}
|
||||
onTouchStart={e => onSelectStart(getTouchCoordinates(e.nativeEvent))}
|
||||
onMouseDown={() => onSelectStart()}
|
||||
onTouchMove={e => onSelectMove(getTouchCoordinates(e.nativeEvent))}
|
||||
onTouchEnd={() => onSelectEnd(prediction)}
|
||||
onMouseUp={() => onSelectEnd(prediction)}
|
||||
onTouchStart={e => {
|
||||
e.preventDefault();
|
||||
onSelectStart(getTouchCoordinates(e.nativeEvent));
|
||||
}}
|
||||
onMouseDown={e => {
|
||||
e.preventDefault();
|
||||
onSelectStart();
|
||||
}}
|
||||
onTouchMove={e => {
|
||||
e.preventDefault();
|
||||
onSelectMove(getTouchCoordinates(e.nativeEvent));
|
||||
}}
|
||||
onTouchEnd={e => {
|
||||
e.preventDefault();
|
||||
onSelectEnd(prediction);
|
||||
}}
|
||||
onMouseUp={e => {
|
||||
e.preventDefault();
|
||||
onSelectEnd(prediction);
|
||||
}}
|
||||
>
|
||||
{predictionId === CURRENT_LOCATION_ID ? (
|
||||
<span className={css.currentLocation}>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue