Skip to content

Commit

Permalink
fix(Designer): Override default Paste Behavior on FireFox (#4378)
Browse files Browse the repository at this point in the history
* update the whole token instead

* override default topic
  • Loading branch information
Eric-B-Wu committed Mar 17, 2024
1 parent 0b3d3ec commit 6a2e972
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libs/designer-ui/src/lib/editor/base/plugins/Paste.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export const PastePlugin = ({ segmentMapping, loadParameterValueFromString }: Pa
const clipboardData = event instanceof InputEvent || event instanceof KeyboardEvent ? null : event.clipboardData;
const lexicalString = clipboardData?.getData('text/plain').replace(/\r\n/g, '\n');
if (lexicalString && segmentMapping && loadParameterValueFromString) {
// normally we can overwrite default paste behavior by returning true
// however on firefox this doesn't happen, so we've manually called preventDefault
event.preventDefault();
const valueSegments = loadParameterValueFromString(lexicalString);
editor.update(() => {
// Get the selection from the EditorState
Expand Down

0 comments on commit 6a2e972

Please sign in to comment.