mirror of
https://github.com/codex-team/editor.js
synced 2024-06-18 13:45:20 +02:00
Fix paste module to support Microsoft Edge (#640)
This commit is contained in:
parent
d9bb7ff958
commit
b2d85d3ae6
6
dist/editor.js
vendored
6
dist/editor.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,9 @@
|
|||
# Changelog
|
||||
|
||||
### 2.11.6
|
||||
|
||||
- `Fix` *Paste* — Polyfill for Microsoft Edge
|
||||
|
||||
### 2.11.5
|
||||
|
||||
- `Fix` *RectangeSelection* — Redesign of the scrolling zones
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@editorjs/editorjs",
|
||||
"version": "2.11.5",
|
||||
"version": "2.11.6",
|
||||
"description": "Editor.js — Native JS, based on API and Open Source",
|
||||
"main": "dist/editor.js",
|
||||
"types": "./types/index.d.ts",
|
||||
|
|
|
@ -139,7 +139,14 @@ export default class Paste extends Module {
|
|||
public async processDataTransfer(dataTransfer: DataTransfer, isDragNDrop = false): Promise<void> {
|
||||
const { Sanitizer } = this.Editor;
|
||||
|
||||
if (dataTransfer.types.includes('Files')) {
|
||||
const types = dataTransfer.types;
|
||||
|
||||
/**
|
||||
* In Microsoft Edge types is DOMStringList. So 'contains' is used to check if 'Files' type included
|
||||
*/
|
||||
const includesFiles = types.includes ? types.includes('Files') : (types as any).contains('Files');
|
||||
|
||||
if (includesFiles) {
|
||||
await this.processFiles(dataTransfer.files);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue