Skip to content

Commit

Permalink
Add allowSyncAcceptAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
rikschennink committed Jun 9, 2020
1 parent 61f0e62 commit 1f9415c
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 9 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.16.0

- Add `allowSyncAcceptAttribute`, set to `false` to prevent FilePond from setting the file input field `accept` attribute to the value of the `acceptedFileTypes`.


## 4.15.1

- Fix issue with abort being called even when not supplied.
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.15.1
* FilePond 4.16.0
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/
Expand Down
6 changes: 5 additions & 1 deletion dist/filepond.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* FilePond 4.15.1
* FilePond 4.16.0
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/
Expand Down Expand Up @@ -1880,6 +1880,9 @@ const defaultOptions = {
// - Does not work with multiple on apple devices
// - If set, acceptedFileTypes must be made to match with media wildcard "image/*", "audio/*" or "video/*"

// sync `acceptedFileTypes` property with `accept` attribute
allowSyncAcceptAttribute: [true, Type.BOOLEAN],

// Feature toggles
allowDrop: [true, Type.BOOLEAN], // Allow dropping of files
allowBrowse: [true, Type.BOOLEAN], // Allow browsing the file system
Expand Down Expand Up @@ -6898,6 +6901,7 @@ const create$a = ({ root, props }) => {
};

const setAcceptedFileTypes = ({ root, action }) => {
if (!root.query('GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE')) return;
attrToggle(
root.element,
'accept',
Expand Down
4 changes: 2 additions & 2 deletions dist/filepond.esm.min.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion dist/filepond.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* FilePond 4.15.1
* FilePond 4.16.0
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/
Expand Down Expand Up @@ -3914,6 +3914,9 @@
// - Does not work with multiple on apple devices
// - If set, acceptedFileTypes must be made to match with media wildcard "image/*", "audio/*" or "video/*"

// sync `acceptedFileTypes` property with `accept` attribute
allowSyncAcceptAttribute: [true, Type.BOOLEAN],

// Feature toggles
allowDrop: [true, Type.BOOLEAN], // Allow dropping of files
allowBrowse: [true, Type.BOOLEAN], // Allow browsing the file system
Expand Down Expand Up @@ -9660,6 +9663,7 @@
var setAcceptedFileTypes = function setAcceptedFileTypes(_ref2) {
var root = _ref2.root,
action = _ref2.action;
if (!root.query('GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE')) return;
attrToggle(
root.element,
'accept',
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.15.1",
"version": "4.16.0",
"description": "FilePond, Where files go to stretch their bits.",
"license": "MIT",
"author": {
Expand Down
3 changes: 3 additions & 0 deletions src/js/app/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ export const defaultOptions = {
// - Does not work with multiple on apple devices
// - If set, acceptedFileTypes must be made to match with media wildcard "image/*", "audio/*" or "video/*"

// sync `acceptedFileTypes` property with `accept` attribute
allowSyncAcceptAttribute: [true, Type.BOOLEAN],

// Feature toggles
allowDrop: [true, Type.BOOLEAN], // Allow dropping of files
allowBrowse: [true, Type.BOOLEAN], // Allow browsing the file system
Expand Down
1 change: 1 addition & 0 deletions src/js/app/view/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const create = ({ root, props }) => {
};

const setAcceptedFileTypes = ({ root, action }) => {
if (!root.query('GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE')) return;
attrToggle(
root.element,
'accept',
Expand Down

0 comments on commit 1f9415c

Please sign in to comment.