Skip to content

Commit

Permalink
#1517: Mark Chrome for Android as not supporting native DnD
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-m1 committed Jun 14, 2019
1 parent 2ca1ff5 commit 0738f37
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
21 changes: 7 additions & 14 deletions src/BrowserInfo.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
function userAgent(pattern) {
return !!navigator.userAgent.match(pattern);
return !!/*@__PURE__*/navigator.userAgent.match(pattern);
}

const IE11OrLess = /*@__PURE__*/userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
const Edge = /*@__PURE__*/userAgent(/Edge/i);
const FireFox = /*@__PURE__*/userAgent(/firefox/i);
const Safari = /*@__PURE__*/userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
const IOS = /*@__PURE__*/userAgent(/iP(ad|od|hone)/i);

export {
IE11OrLess,
Edge,
FireFox,
Safari,
IOS
};
export const IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
export const Edge = userAgent(/Edge/i);
export const FireFox = userAgent(/firefox/i);
export const Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
export const IOS = userAgent(/iP(ad|od|hone)/i);
export const ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
4 changes: 2 additions & 2 deletions src/Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { version } from '../package.json';

import { IE11OrLess, Edge, FireFox, Safari, IOS } from './BrowserInfo.js';
import { IE11OrLess, Edge, FireFox, Safari, IOS, ChromeForAndroid } from './BrowserInfo.js';

import AnimationStateManager from './Animation.js';

Expand Down Expand Up @@ -143,7 +143,7 @@ let dragEl,
CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',

// This will not pass for IE9, because IE9 DnD only works on anchors
supportDraggable = ('draggable' in document.createElement('div')),
supportDraggable = !ChromeForAndroid && ('draggable' in document.createElement('div')),

supportCssPointerEvents = (function() {
// false when <= IE11
Expand Down

0 comments on commit 0738f37

Please sign in to comment.