jquery-locationpicker-plugin icon indicating copy to clipboard operation
jquery-locationpicker-plugin copied to clipboard

scrollWheel: true default option is "not recommended" and causes compatibility behavior to trigger

Open kolen opened this issue 7 years ago • 0 comments

In current Google Maps API 3.31 scrollWheel option is marked as "not recommended"

scrollwheel

Type: boolean

If false, disables zooming on the map using a mouse scroll wheel. The scrollwheel is enabled by default.

Note: This property is not recommended. To disable zooming using scrollwheel, you can use the gestureHandling property, and set it to either "cooperative" or "none".

Despite looking like scrollwheel is true by default in Google Maps, setting it to true explicitly turns on "legacy compatibility behavior": gestureHandling is completely ignored.

By default, in current versions of Google Maps, mouse wheel zooms only if ctrl/cmd is pressed, if it detects that page is scrollable. Setting scrollwheel to true when constructing Map disables this, which makes scrolling of page more painful (locationpicker is often used for editors such as in admin UIs where there are lots of fields in addition to location editor).

It's set here:

https://github.com/Logicify/jquery-locationpicker-plugin/blob/fac8658119043e830e0cbccd14b8b22bde08436b/src/locationpicker.jquery.js#L442

https://github.com/Logicify/jquery-locationpicker-plugin/blob/fac8658119043e830e0cbccd14b8b22bde08436b/src/locationpicker.jquery.js#L386

kolen avatar Mar 13 '18 15:03 kolen