1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-13 18:53:59 +02:00

fix: add support for pasting plain text into editable void (#5305)

This commit is contained in:
alex-vladut
2023-02-22 22:47:38 +02:00
committed by GitHub
parent 84f811a79c
commit 11adbf966c
2 changed files with 6 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
'slate-react': patch
---
Allow pasting plain text into editable voids

View File

@@ -1610,7 +1610,7 @@ export const Editable = (props: EditableProps) => {
(event: React.ClipboardEvent<HTMLDivElement>) => {
if (
!readOnly &&
ReactEditor.hasSelectableTarget(editor, event.target) &&
ReactEditor.hasEditableTarget(editor, event.target) &&
!isEventHandled(event, attributes.onPaste)
) {
// COMPAT: Certain browsers don't support the `beforeinput` event, so we