refactor: use ClipboardEvent interface for file paste command
This commit is contained in:
@@ -59,7 +59,7 @@ export default function FilePlugin(): JSX.Element | null {
|
|||||||
editor.registerCommand(
|
editor.registerCommand(
|
||||||
PASTE_COMMAND,
|
PASTE_COMMAND,
|
||||||
(payload) => {
|
(payload) => {
|
||||||
const files = payload instanceof InputEvent ? payload.dataTransfer?.files : null
|
const files = payload instanceof ClipboardEvent ? payload.clipboardData?.files : null
|
||||||
if (files?.length) {
|
if (files?.length) {
|
||||||
uploadFilesList(files)
|
uploadFilesList(files)
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user