Skip to content

Commit

Permalink
fix(portable-text-editor): fix wrong type option sent to custom paste…
Browse files Browse the repository at this point in the history
… handler

The wrong type was sent in here, it should be the PT array type and not the block type
  • Loading branch information
skogsmaskin committed Mar 29, 2022
1 parent a114845 commit f746973
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@sanity/portable-text-editor/src/editor/Editable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ export const PortableTextEditable = forwardRef(function PortableTextEditable(
value: PortableTextEditor.getValue(portableTextEditor),
path: slateEditor.selection?.focus.path || [],
portableTextFeatures, // New key added in v.2.23.2
type: blockType, // For legacy support
type: portableTextFeatures.types.portableText, // For legacy support
})
} catch (error) {
return error as Error
Expand Down Expand Up @@ -386,7 +386,7 @@ export const PortableTextEditable = forwardRef(function PortableTextEditable(
event.preventDefault()
slateEditor.insertData(event.clipboardData)
},
[blockType, change$, onPaste, portableTextEditor, portableTextFeatures, slateEditor]
[change$, onPaste, portableTextEditor, portableTextFeatures, slateEditor]
)

const _isSelecting = useRef(false)
Expand Down

0 comments on commit f746973

Please sign in to comment.