Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dragging doesn't prevent scrolling on mobile #132

Open
nekojanai opened this issue Mar 29, 2019 · 1 comment
Open

dragging doesn't prevent scrolling on mobile #132

nekojanai opened this issue Mar 29, 2019 · 1 comment

Comments

@nekojanai
Copy link

Tried to drag a widget in chrome dev tools mobile view, console went haywire with the following error:

[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See <URL>
[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080

preventDefault @ jquery3.self-5af507e253c37e9c9dcf65064fc3f93795e6e28012780579975a4d709f4074ad.js?body=1:5423
fn.on_dragstart @ jquery.dsmorse-gridster.self-cfb002bbf694b3a9005ae7a21ee4439fc439d4e82bb4ed555a03c921f7166440.js?body=1:786
(anonymous) @ jquery.dsmorse-gridster.self-cfb002bbf694b3a9005ae7a21ee4439fc439d4e82bb4ed555a03c921f7166440.js?body=1:770
dispatch @ jquery3.self-5af507e253c37e9c9dcf65064fc3f93795e6e28012780579975a4d709f4074ad.js?body=1:5184
elemData.handle @ jquery3.self-5af507e253c37e9c9dcf65064fc3f93795e6e28012780579975a4d709f4074ad.js?body=1:4992

How I intitialized gridster:

  var gridsterEdit;

  gridsterEdit = $(".gridsterEdit .gridster ul").gridster({
    widget_base_dimensions: ['auto',50],
    widget_margins: [5,5],
    max_cols: 12,
    max_rows: 12,
    shift_widgets_up: false,
    shift_larger_widgets_down: false,
    autogenerate_stylesheet: true,
    serialize_params: function($w, wgd) {
      return { name: $w.data('name'), col: wgd.col, row: wgd.row, size_x: wgd.size_x, size_y: wgd.size_y }
    },
    collision: {
      wait_for_mouseup: true,
    },
    draggable: {
      stop: function (e,ui,$widget) {
        $("#misc").val(JSON.stringify(gridsterEdit.serialize()));
        console.log(gridsterEdit.serialize());
      },
    },
    disabled: true,
  }).data('gridster');
@nekojanai
Copy link
Author

Seems like this issue isn't trivial to resolve or is it?
The problem is related to this change in Chrome.
And this library attaches the event via jQuery and the guys over there also didn't come up with a solution yet.

I haven't looked into it that much, but will have to at some point, so...

Anyone more experienced that may be able to comment on my naive assumption that it could be as easy as changing this line:

this.$document.on(this.pointer_events.move, function(mme) {

to use the vanilla js variant of attaching events plus including the options hash? with passive: false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant