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

Does not automatically apply in iOS/iPad 15 when desktop website is requested #167

Open
jogibear9988 opened this issue Dec 23, 2021 · 3 comments

Comments

@jogibear9988
Copy link
Contributor

The polyfill does not work on IOS 15 any more, cause the useragent changed, and does not contain "iPad" or "iPhone"

@jogibear9988
Copy link
Contributor Author

I would suggest following code:

navigator.maxTouchPoints && navigator.userAgent.includes('Safari') && !navigator.userAgent.includes('Chrome'),

@reppners
Copy link
Collaborator

reppners commented Dec 29, 2021

Thanks for reporting. I was afraid a breaking change like that would happen eventually 😞

For everyone affected: It is possible, to use the forceApply flag in the polyfill config to provide your own feature-detection until the polyfill is released with adjusted default feature detection.

The current code is

const isBlinkEngine = !!((<any>window).chrome) || /chrome/i.test( navigator.userAgent );
features.userAgentSupportingNativeDnD = !(
// if is mobile safari or android browser -> no native dnd
(/iPad|iPhone|iPod|Android/.test( navigator.userAgent ))
|| // OR
//if is blink(chrome/opera) with touch events enabled -> no native dnd
(isBlinkEngine && ("ontouchstart" in document.documentElement))
);

Relates to #152

@reppners
Copy link
Collaborator

reppners commented Dec 29, 2021

So I got around to play a little with an iPad Pro which has iOS 15.2 installed.

Requesting the desktop site (Safari feature which users can toggle to their liking) causes the User Agent to contain Macintosh instead of iPad. The polyfill does not kick in, but with some minor fixing the demo site of this polyfill works fine (mainly fixing some glitches, no real problems). It is quite similar to the "holdToDrag" experience.

Requesting the mobile site the User Agent contains iPad, the polyfill kicks in and drag and drop works as configured.

So to me, not fixing the user agent does not break an application. It just may behave a little different if e.g. no or a different holdToDrag is configured.

My personal opinion is that the polyfill should not take away the native experience by default, meaning that it is fine as is, but the current state of drag and drop should be refreshed and available options may should be made more visible in the README.

I don't own an Android device and only rely on Chrome mobile emulation for testing. Does anyone know if that is accurate enough to conduct testing if Android native drag and drop does work? I could of course also spin up an Android Emulator.. but time and energy are scarce for me, meaning I have to keep it as simple and easy as possible.

EDIT: I also checked if the polyfill and native experience step on their toes but they seem to be working fine side by side.

@reppners reppners changed the title Does not work on IOS 15 Does not automatically apply in iOS 15 Dec 29, 2021
@reppners reppners changed the title Does not automatically apply in iOS 15 Does not automatically apply in iOS/iPad 15 when desktop website is requested Dec 29, 2021
bn-pass added a commit to hpi-schul-cloud/nuxt-client that referenced this issue Dec 15, 2022
bn-pass added a commit to hpi-schul-cloud/nuxt-client that referenced this issue Dec 19, 2022
#2342)

* modify defaulty mobile-drag-drop lib behaviour - add flag to forcefully apply polyfilling (see timruffles/mobile-drag-drop#167 for more)

* add comment for the forceApply flag

Co-authored-by: Murat Merdoglu <64781656+muratmerdoglu-dp@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants