Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Paste without Formatting / Paste and Match Style producing uneditable text nodes. #3415

Open
wants to merge 2 commits into
base: master
from

Conversation

@Killavus
Copy link

Killavus commented Jan 9, 2020

Is this adding or improving a feature or fixing a bug?

Fixing a bug.

What's the new behavior?

This fixes #3414. Basically right now Paste and Match Style type of pasting from Chrome is working properly - as well as mod+shift+v shortcut from other browsers.

How does this change work?

Since these types of pastes are not emitting beforeinput events, I handle them in paste event handler. After that it's just a matter of simply passing them to insertData of ReactEditor. I want to minimize the surface area of change, so this behavior is triggered only for pastes having exclusively text/plain ClipboardData in them.

Have you checked that...?

  • The new code matches the existing patterns and styles.
  • The tests pass with yarn test.
  • The linter passes with yarn lint. (Fix errors with yarn fix.)
  • The relevant examples still work. (Run examples with yarn start.)

Does this fix any issues or need any specific reviewers?

Fixes: #3414
Reviewers: @

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

1 participant
You can’t perform that action at this time.