Skip to content

Commit

Permalink
fix chrome android pull to refresh bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rikschennink committed Dec 13, 2019
1 parent 7de04d0 commit 8865fdc
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 16 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 4.9.1

- Fix issue where Chrome on Android would launch pull-to-refresh when trying to drag a file item.


## 4.9.0

- Add drag to reorder file items, enable by setting `allowReorder` to `true`.
Expand Down
2 changes: 1 addition & 1 deletion dist/filepond.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* FilePond 4.9.0
* FilePond 4.9.1
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/
Expand Down
7 changes: 5 additions & 2 deletions dist/filepond.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* FilePond 4.9.0
* FilePond 4.9.1
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/
Expand Down Expand Up @@ -7816,7 +7816,10 @@ const create$d = ({ root, props }) => {
root.ref.updateHistory = [];

// prevent scrolling and zooming on iOS (only if supports pointer events, for then we can enable reorder)
if (root.query('GET_ALLOW_REORDER') && 'onpointerdown' in window && isIOS()) {
const canHover = window.matchMedia('(pointer: fine) and (hover: hover)')
.matches;
const hasPointerEvents = 'PointerEvent' in window;
if (root.query('GET_ALLOW_REORDER') && hasPointerEvents && !canHover) {
root.element.addEventListener('touchmove', prevent, { passive: false });
root.element.addEventListener('gesturestart', prevent);
}
Expand Down
4 changes: 2 additions & 2 deletions dist/filepond.esm.min.js

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions dist/filepond.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* FilePond 4.9.0
* FilePond 4.9.1
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/
Expand Down Expand Up @@ -10661,11 +10661,10 @@
root.ref.updateHistory = [];

// prevent scrolling and zooming on iOS (only if supports pointer events, for then we can enable reorder)
if (
root.query('GET_ALLOW_REORDER') &&
'onpointerdown' in window &&
isIOS()
) {
var canHover = window.matchMedia('(pointer: fine) and (hover: hover)')
.matches;
var hasPointerEvents = 'PointerEvent' in window;
if (root.query('GET_ALLOW_REORDER') && hasPointerEvents && !canHover) {
root.element.addEventListener('touchmove', prevent, { passive: false });
root.element.addEventListener('gesturestart', prevent);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/filepond.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/filepond.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "filepond",
"version": "4.9.0",
"version": "4.9.1",
"description": "FilePond, Where files go to stretch their bits.",
"license": "MIT",
"author": {
Expand Down
4 changes: 3 additions & 1 deletion src/js/app/view/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ const create = ({ root, props }) => {
root.ref.updateHistory = [];

// prevent scrolling and zooming on iOS (only if supports pointer events, for then we can enable reorder)
if (root.query('GET_ALLOW_REORDER') && 'onpointerdown' in window && isIOS()) {
const canHover = window.matchMedia('(pointer: fine) and (hover: hover)').matches;
const hasPointerEvents = 'PointerEvent' in window;
if (root.query('GET_ALLOW_REORDER') && hasPointerEvents && !canHover) {
root.element.addEventListener('touchmove', prevent, { passive: false });
root.element.addEventListener('gesturestart', prevent);
}
Expand Down

0 comments on commit 8865fdc

Please sign in to comment.