application/x-slate-fragment data is set in the clipboard (the empty selected element is not meaningless since there's other data on the it, e.g. imageUrl property).
I'm currently working around this issue with this plugin:
Slate's selections work with text so I feel like this is expected behavior. If you want the image to be selectable you gotta make it a void node so that a zero-width-space is inserted that can be selected.
Do you want to request a feature or report a bug?
Bug.
What's the current behavior?
Copying (Ctrl+C) empty non-void element does not work.
Reproduction steps:
Actual result: Clipboard is not modified.
Range.isCollapsed(editor, editor.selection)
condition causessetFragmentData
to return without modifying clipboard: https://github.com/ianstormtaylor/slate/blob/97dbab1/packages/slate-react/src/plugin/with-react.ts#L71-L73Slate: 0.59.0 Browser: All OS: All
What's the expected behavior?
application/x-slate-fragment
data is set in the clipboard (the empty selected element is not meaningless since there's other data on the it, e.g.imageUrl
property).I'm currently working around this issue with this plugin: