Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

feat(src): pasting clause uses new uuid - I88 #89

Merged
merged 3 commits into from
Sep 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@
"slate-react": "^0.22.4",
"style-loader": "^0.23.1"
}
}
}
18 changes: 9 additions & 9 deletions src/SlateAsInputEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,16 +367,16 @@ const SlateAsInputEditor = React.forwardRef((props, ref) => {
const onPaste = (event, editor, next) => {
if (isEditable(editor, 'paste')) {
const transfer = getEventTransfer(event);
if (transfer.type !== 'html') return next();
const pluginManager = new PluginManager(props.plugins);
const fromHtml = new FromHTML(pluginManager);
// @ts-ignore
const { document } = fromHtml.convert(editor, transfer.html);
editor.insertFragment(document);
return undefined;
if (transfer.type === 'html') {
const pluginManager = new PluginManager(props.plugins);
const fromHtml = new FromHTML(pluginManager);
// @ts-ignore
const { document } = fromHtml.convert(editor, transfer.html);
editor.insertFragment(document);
return;
}
}

return false;
return next();
};

/**
Expand Down