Skip to content

Commit 6a2e972

Browse files
authored
fix(Designer): Override default Paste Behavior on FireFox (#4378)
* update the whole token instead * override default topic
1 parent 0b3d3ec commit 6a2e972

File tree

1 file changed

+3
-0
lines changed
  • libs/designer-ui/src/lib/editor/base/plugins

1 file changed

+3
-0
lines changed

libs/designer-ui/src/lib/editor/base/plugins/Paste.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export const PastePlugin = ({ segmentMapping, loadParameterValueFromString }: Pa
2424
const clipboardData = event instanceof InputEvent || event instanceof KeyboardEvent ? null : event.clipboardData;
2525
const lexicalString = clipboardData?.getData('text/plain').replace(/\r\n/g, '\n');
2626
if (lexicalString && segmentMapping && loadParameterValueFromString) {
27+
// normally we can overwrite default paste behavior by returning true
28+
// however on firefox this doesn't happen, so we've manually called preventDefault
29+
event.preventDefault();
2730
const valueSegments = loadParameterValueFromString(lexicalString);
2831
editor.update(() => {
2932
// Get the selection from the EditorState

0 commit comments

Comments
 (0)