mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-15 11:44:05 +02:00
Resolves iamstormtaylor/slate#3778: Check if editable target before handling paste event (#3779)
This commit is contained in:
@@ -946,11 +946,11 @@ export const Editable = (props: EditableProps) => {
|
||||
// when "paste without formatting" option is used.
|
||||
// This unfortunately needs to be handled with paste events instead.
|
||||
if (
|
||||
hasEditableTarget(editor, event.target) &&
|
||||
!isEventHandled(event, attributes.onPaste) &&
|
||||
(!HAS_BEFORE_INPUT_SUPPORT ||
|
||||
isPlainTextOnlyPaste(event.nativeEvent)) &&
|
||||
!readOnly &&
|
||||
hasEditableTarget(editor, event.target)
|
||||
!readOnly
|
||||
) {
|
||||
event.preventDefault()
|
||||
ReactEditor.insertData(editor, event.clipboardData)
|
||||
|
Reference in New Issue
Block a user