Skip to content

Commit

Permalink
fix(filepond): clear field class, fix issues with Bootstrap 4
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi committed Oct 3, 2024
1 parent 1bea466 commit 9afdab3
Show file tree
Hide file tree
Showing 5 changed files with 568 additions and 561 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.11.0

* test: modernization
* fix(filepond): clear field class, fix issues with Bootstrap 4

## 1.10.2

Expand Down
11 changes: 10 additions & 1 deletion packages/file-filepond/assets/dist/filepond.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,27 @@ var _default = /*#__PURE__*/function (_Controller) {
_proto.connect = function connect() {
var files = [];
var input;

// get the file input element
for (var _iterator = _createForOfIteratorHelperLoose(this.element.children), _step; !(_step = _iterator()).done;) {
var child = _step.value;
if (child.tagName === 'INPUT' && child.type === 'file') {
input = child;
}
}

// remove input class attribute
input.removeAttribute('class');

// get the files from the data elements and process them
for (var _iterator2 = _createForOfIteratorHelperLoose(this.element.children), _step2; !(_step2 = _iterator2()).done;) {
var _child = _step2.value;
if (_child.tagName !== 'DATA') {
continue;
}
var file = {
// sentinel value sent to server. if this is value is sent
// to the server, then the user didn't remove the image from
// to the server, then the user has not removed the image from
// the filepond field
source: _child.dataset.id || '__NOT_DELETED__',
options: {
Expand All @@ -163,6 +170,8 @@ var _default = /*#__PURE__*/function (_Controller) {
}
files.push(file);
}

// create filepond instance
FilePond.create(input, _extends({}, getCurrentLocale(), {
storeAsFile: true,
files: files
Expand Down
Loading

0 comments on commit 9afdab3

Please sign in to comment.