openseadragon-imaging / openseadragon-viewerinputhook

MIT License
3 stars 1 forks source link

preventDefaultAction broken on OpenSeaDragon v3 #16

Open ChrisHSandN opened 2 years ago

ChrisHSandN commented 2 years ago

Description

openseadragon-viewerinputhook preventDefaultAction no longer functions on v3 of OSD. The hookHandler gets called, however the viewer image continues to pan around.

JS Fiddle:

Working on 2.4.2 https://jsfiddle.net/chris_h/0nd9pbhf/ Broken on 3.1.0: https://jsfiddle.net/chris_h/4dcpwm38/

Testcase

  var viewer = OpenSeadragon({
    id: "osd",
    tileSources: [{
      type: "image",
      url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAABhElEQVR42u3TAQ0AAAgDIN8/9C1gAgcdyLQd4BRBQBAQBAQBQUAQEAQEAUFAEEAQEAQEAUFAEBAEBAFBQBAQRBAQBAQBQUAQEAQEAUFAEBAEEAQEAUFAEBAEBAFBQBAQBAQBBAFBQBAQBAQBQUAQEAQEAQQBQUAQEAQEAUFAEBAEBAFBAEFAEBAEBAFBQBAQBAQBQQBBQBAQBAQBQUAQEAQEAUFAEEAQEAQEAUFAEBAEBAFBQBAQRBAQBAQBQUAQEAQEAUFAEBAEEAQEAUFAEBAEBAFBQBAQBAQRBAQBQUAQEAQEAUFAEBAEBAEEAUFAEBAEBAFBQBAQBAQBQQBBQBAQBAQBQUAQEAQEAUEAQUAQEAQEAUFAEBAEBAFBQBBAEBAEBAFBQBAQBAQBQUAQQBAQBAQBQUAQEAQEAUFAEBAEEAQEAUFAEBAEBAFBQBAQBAQRBAQBQUAQEAQEAUFAEBAEBAEEAUFAEBAEBAFBQBAQBAQBQQQBQUAQEAQEAUFAEBAEPlo7TFaPRUFQyQAAAABJRU5ErkJggg=="
    }]
  });

  new OpenSeadragonImaging.ViewerInputHook({
    viewer: viewer,
    hooks: [{
      tracker: 'viewer',
      handler: 'dragHandler',
      hookHandler: function(event) {
        event.preventDefaultAction = true;
      }
    }, ]
  });
<div id="osd"></div>
#osd
{
  width: 500px;
  height: 500px;
}
iangilman commented 2 years ago

@msalsbery Any thoughts?