Flyer53 / jsPanel3

A jQuery Plugin to create highly configurable floating panels, modals, tooltips, hints/notifiers or contextmenus for use in a backend solution and other web applications.
http://v3.jspanel.de/
Other
89 stars 21 forks source link

Dragging doesn't work for mouse/touchpad if touchscreen is also available #58

Closed swelljoe closed 6 years ago

swelljoe commented 6 years ago

Tested on Fedora 26 Linux with Firefox developer edition 57.0b11 (64-bit) and Chrome 62.0.3202.62 (Official Build) (64-bit).

When a touchscreen is present, jsPanel doesn't seem to attach any events for mouse dragging/resizing, so the mouse acts normally even though the cursor changes to indicate drag actions are available. The only event I see attached to the window is "touchstart", with nothing for the mouse.

I am able to use the touch actions to drag and resize correctly.

I don't understand touchscreen detection well enough to understand what's happening here, or how to fix it, exactly, but it seems like just adding mouse events would solve this.

I've got both a touchpad and a regular three-button/scroll mouse, and neither works for dragging/resizing.

I seem to recall this worked correctly in Chrome on this same machine in an older version of jsPanel, but it has never worked on Firefox. I'm just now getting around to looking into why.

Flyer53 commented 6 years ago

@swelljoe The current v3.x jsPanel uses touch events if available and mouse events if not, but not both. I'm aware of the fact that this is not ideal for devices that offer both, touch and mouse. I have a change in mind that might work for both, but since I don't have a device supporting touch and mouse it's a bit difficult to test. If you're willing to check it out I could offer you a download of a modified version within the next few days I guess.

Btw: For jsPanel v4 I plan to use pointer events, so this wouldn't be an issue anymore.

swelljoe commented 6 years ago

Cool, thanks for the update! As I understand it (from a brief reading), the solution is to attach events for either and then preventDefault if a touch event is fired so both don't get fired.

I'd be happy to test if you do any experiments. It's not all that big of a deal, I guess not many people yet have both touch and mouse on the same system, but we've had a few folks notice it in our project that uses jsPanel. If I get more time to wrap my head around how this stuff is supposed to work, I might try making a patch, but this is definitely not my area of expertise.

Flyer53 commented 6 years ago

@swelljoe Just for info: Drag/Resize of jsPanel v4 alpha on a Galaxy Tab S3 works with touch AND pen AND mouse (checked with a bluetooth mouse). At least on browsers that already support pointer events

I try to get something done with jsPanel v3.x sometime next week.

But note that I do not use any Linux devices. Don't know whether this makes a difference.

Flyer53 commented 6 years ago

@swelljoe I prepared a preliminary jsPanel v3.12.0 that should work with both touch AND mouse if both is available. First basic test on Windows desktops and Android/IOS tablet works fine. Please download from http://jspanel.de/downloads/jquery.jspanel-compiled-3.12.0.zip (it's just the compiled script) and check out yourself. If no problems turn up it'll be part of an official 3.12 release.

Regards, Stefan

swelljoe commented 6 years ago

It works! Thank you!