Skip to content

Commit b66ac61

Browse files
committed
fix field disabled attribute stuck
1 parent 572930d commit b66ac61

10 files changed

Lines changed: 37 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 4.31.3
4+
5+
- Fix issue where hidden input fields in `filepond--data` fieldset would stay disabled after enabling FilePond. #1001
6+
37
## 4.31.2
48

59
- Remove `aria-hidden` from drop label as suggested by Lighthouse.

dist/filepond.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* FilePond 4.31.2
2+
* FilePond 4.31.3
33
* Licensed under MIT, https://opensource.org/licenses/MIT/
44
* Please visit https://pqina.nl/filepond/ for details.
55
*/

dist/filepond.esm.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* FilePond 4.31.2
2+
* FilePond 4.31.3
33
* Licensed under MIT, https://opensource.org/licenses/MIT/
44
* Please visit https://pqina.nl/filepond/ for details.
55
*/
@@ -7149,7 +7149,6 @@ const didAddItem = ({ root, action }) => {
71497149
const dataContainer = createElement$1('input');
71507150
dataContainer.type = shouldUseFileInput ? 'file' : 'hidden';
71517151
dataContainer.name = root.query('GET_NAME');
7152-
dataContainer.disabled = root.query('GET_DISABLED');
71537152
root.ref.fields[action.id] = dataContainer;
71547153
syncFieldPositionsWithItems(root);
71557154
};

dist/filepond.esm.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/filepond.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* FilePond 4.31.2
2+
* FilePond 4.31.3
33
* Licensed under MIT, https://opensource.org/licenses/MIT/
44
* Please visit https://pqina.nl/filepond/ for details.
55
*/
@@ -9832,7 +9832,6 @@
98329832
var dataContainer = createElement$1('input');
98339833
dataContainer.type = shouldUseFileInput ? 'file' : 'hidden';
98349834
dataContainer.name = root.query('GET_NAME');
9835-
dataContainer.disabled = root.query('GET_DISABLED');
98369835
root.ref.fields[action.id] = dataContainer;
98379836
syncFieldPositionsWithItems(root);
98389837
};

dist/filepond.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/filepond.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,41 @@
2525

2626
<script src="./dist/filepond.js"></script>
2727

28+
<button type="button" id="disable">Disable</button>
29+
<button type="button" id="enable">Enable</button>
30+
2831
<script>
2932
// Get a reference to the file input element
3033
const inputElement = document.querySelector('input[type="file"]');
3134

3235
// Create the FilePond instance
3336
const pond = FilePond.create(inputElement, {
3437
allowMultiple: true,
35-
allowReorder: true,
38+
server: {
39+
load: 'https://i.imgur.com/',
40+
},
41+
files: [
42+
{
43+
source: 'rBkbXS3.jpeg',
44+
options: {
45+
type: 'local',
46+
},
47+
},
48+
],
49+
storeAsFile: true,
50+
disabled: true,
3651
});
3752

3853
// Easy console access for testing purposes
3954
window.pond = pond;
55+
56+
document.querySelector('#disable').onclick = function() {
57+
pond.setOptions({ disabled: true });
58+
};
59+
60+
document.querySelector('#enable').onclick = function() {
61+
pond.setOptions({ disabled: false });
62+
};
4063
</script>
4164
</body>
4265
</html>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "filepond",
3-
"version": "4.31.2",
3+
"version": "4.31.3",
44
"description": "FilePond, Where files go to stretch their bits.",
55
"license": "MIT",
66
"author": {

src/js/app/view/data.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ const didAddItem = ({ root, action }) => {
2323
const dataContainer = createElement('input');
2424
dataContainer.type = shouldUseFileInput ? 'file' : 'hidden';
2525
dataContainer.name = root.query('GET_NAME');
26-
dataContainer.disabled = root.query('GET_DISABLED');
2726
root.ref.fields[action.id] = dataContainer;
2827
syncFieldPositionsWithItems(root);
2928
};

0 commit comments

Comments
 (0)