Skip to content

Commit ed452a9

Browse files
committed
fix contenteditable bug
1 parent a1c7ac7 commit ed452a9

8 files changed

Lines changed: 25 additions & 11 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.4
4+
5+
- Fix issue where images pasted in contenteditable elements would be handled by FilePond.
6+
37
## 4.31.3
48

59
- Fix issue where hidden input fields in `filepond--data` fieldset would stay disabled after enabling FilePond. #1001

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.3
2+
* FilePond 4.31.4
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: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* FilePond 4.31.3
2+
* FilePond 4.31.4
33
* Licensed under MIT, https://opensource.org/licenses/MIT/
44
* Please visit https://pqina.nl/filepond/ for details.
55
*/
@@ -7758,7 +7758,12 @@ const listeners$1 = [];
77587758
const handlePaste = e => {
77597759
// if is pasting in input or textarea and the target is outside of a filepond scope, ignore
77607760
const activeEl = document.activeElement;
7761-
if (activeEl && /textarea|input/i.test(activeEl.nodeName)) {
7761+
const isActiveElementEditable =
7762+
activeEl &&
7763+
(/textarea|input/i.test(activeEl.nodeName) ||
7764+
activeEl.getAttribute('contenteditable') === 'true');
7765+
7766+
if (isActiveElementEditable) {
77627767
// test textarea or input is contained in filepond root
77637768
let inScope = false;
77647769
let element = activeEl;

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: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* FilePond 4.31.3
2+
* FilePond 4.31.4
33
* Licensed under MIT, https://opensource.org/licenses/MIT/
44
* Please visit https://pqina.nl/filepond/ for details.
55
*/
@@ -10505,7 +10505,12 @@
1050510505
var handlePaste = function handlePaste(e) {
1050610506
// if is pasting in input or textarea and the target is outside of a filepond scope, ignore
1050710507
var activeEl = document.activeElement;
10508-
if (activeEl && /textarea|input/i.test(activeEl.nodeName)) {
10508+
var isActiveElementEditable =
10509+
activeEl &&
10510+
(/textarea|input/i.test(activeEl.nodeName) ||
10511+
activeEl.getAttribute('contenteditable') === 'true');
10512+
10513+
if (isActiveElementEditable) {
1050910514
// test textarea or input is contained in filepond root
1051010515
var inScope = false;
1051110516
var element = activeEl;

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.

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.3",
3+
"version": "4.31.4",
44
"description": "FilePond, Where files go to stretch their bits.",
55
"license": "MIT",
66
"author": {

0 commit comments

Comments
 (0)