Skip to content

Add passive scroll - #631

Merged
itsmichaeldiego merged 2 commits into
GoogleMapReact:masterfrom
jooj123:patch/add-passive-scroll
Sep 20, 2018
Merged

itsmichaeldiego merged 2 commits into
GoogleMapReact:masterfrom
jooj123:patch/add-passive-scroll

Conversation

@jooj123

@jooj123 jooj123 commented Aug 15, 2018 •

Copy link
Copy Markdown
Contributor

Added passive scroll event (which is more performant).

See: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener (passive in options)

Needed the feature detection for browsers that dont support it

Note: hard to test this as the demos for google-map-react are all busted due to incorrect google maps key

@itsmichaeldiego

Copy link
Copy Markdown
Member

@jooj123 Is this related to #625 ?

@jooj123

jooj123 commented Aug 16, 2018 •

Copy link
Copy Markdown
Contributor Author

@itsmichaeldiego this is the only place in this lib where it needs a passive event - so it should get rid of the warnings in the console and things should be a bit smoother (so yes its related to #625)

Come to think of it, i might as well add this to the other 4 event listeners too:
https://github.com/google-map-react/google-map-react/blob/6d142cb10cf06effbe035a77506dfad31e73efd3/src/google_map.js#L248

@itsmichaeldiego

Copy link
Copy Markdown
Member

@jooj123 Sounds good, maybe we can create a new method call addPassiveEventListener so we avoid DRY, what do you think?

@jooj123

jooj123 commented Aug 17, 2018

Copy link
Copy Markdown
Contributor Author

@itsmichaeldiego updated. Not sure how i can unit test this as its browser specific functionality
I cant even validate it working correctly without the demo working incorrect due to google maps key

@itsmichaeldiego

Copy link
Copy Markdown
Member

@jooj123 That is fine man! Thanks for this! Could you provide something like a video or whatever so I can see this is working? I really want to merge this but I've no time to test it :(

@itsmichaeldiego

Copy link
Copy Markdown
Member

@jooj123 Bump!

@jooj123

jooj123 commented Sep 14, 2018 •

Copy link
Copy Markdown
Contributor Author

@itsmichaeldiego sorry havent had a chance to test this one - will do sometime over the weekend or next week

It would be much easier if the internal demo worked in this repo :(

@itsmichaeldiego

Copy link
Copy Markdown
Member

@jooj123 What do you mean that the internal demo worked? We're working on new examples at https://github.com/google-map-react/google-map-react-examples

@itsmichaeldiego
itsmichaeldiego merged commit 40c8f67 into GoogleMapReact:master Sep 20, 2018
itsmichaeldiego added a commit that referenced this pull request Sep 21, 2018
itsmichaeldiego added a commit that referenced this pull request Sep 21, 2018
* Revert "Bump version to 1.0.7 (#644)"

This reverts commit 800092a.

* Revert "Add passive scroll (#631)"

This reverts commit 40c8f67.

* Revert "Use React 16 portal to render map overlay (#643)"

This reverts commit b121bb6.
@jooj123
jooj123 deleted the patch/add-passive-scroll branch October 8, 2018 11:20
DonovanDeSmedt added a commit to DonovanDeSmedt/google-map-react that referenced this pull request Nov 21, 2018
* 'master' of github.com:google-map-react/google-map-react:
  Bump to 1.1.1 (GoogleMapReact#680)
  Revert "Added feature: update heat map on data change + fix linting" (GoogleMapReact#679)
  Bump version to 1.1.0 (GoogleMapReact#671)
  Added feature: update heat map on data change + fix linting (GoogleMapReact#593)
  Pass map instance to onDrag handler (GoogleMapReact#656)
  add math abs to avoid negative values when calculating zoom (GoogleMapReact#655)
  Bump version to 1.0.9 (GoogleMapReact#651)
  Custom div style options (GoogleMapReact#634)
  Bump version to 1.0.8 (GoogleMapReact#646)
  Revert 643 fix/map context (GoogleMapReact#645)
  Bump version to 1.0.7 (GoogleMapReact#644)
  Add passive scroll (GoogleMapReact#631)
  Use React 16 portal to render map overlay (GoogleMapReact#643)
  Fix old examples links and add one to new examples (GoogleMapReact#633)
  Bump version to 1.0.6 (GoogleMapReact#621)
  Add prop `onTilesLoaded` (GoogleMapReact#615)
  Fix typo, and call fromContainerPixelToLatLng() as you would expect. (GoogleMapReact#620)
  Update API.md (GoogleMapReact#611)
  Upgrade version to 1.0.5 (GoogleMapReact#607)
  Remove marker jiggle. (GoogleMapReact#603)
@lock

lock Bot commented Dec 1, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Dec 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants