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

editor.insertData() is not triggered on Safari when pasting an image #3664

Closed
heymanhn opened this issue May 8, 2020 · 2 comments
Closed

Comments

@heymanhn
Copy link

heymanhn commented May 8, 2020

Do you want to request a feature or report a bug?

Bug

What's the current behavior?

  1. Load the Slate Images example: https://www.slatejs.org/examples/images
  2. Copy an image from another webpage
  3. Use Command + V to paste it into the demo editor.
  4. Nothing happens; editor.insertData() isn't even triggered.

Video: https://share.getcloudapp.com/v1uDQnj4 (you can't see me hitting cmd + v, but trust me I'm doing it).

Browser: Safari - Version 13.1 (15609.1.20.111.8)
OS: Mac

What's the expected behavior?

editor.insertData() should be triggered and the pasted image available for any custom code to execute.

@mfranzs
Copy link

mfranzs commented Jul 18, 2020

@heymanhn Did you ever find a workaround for this issue?

I'm unsure what the core problem is here. I notice this odd line that changes behavior on Safari, but don't understand the motivation for this check:

(!IS_SAFARI && event.dataTransfer.files.length > 0)

@dylans
Copy link
Collaborator

dylans commented Sep 2, 2021

Likely the same issue as #4465. Closing as duplicate.

@dylans dylans closed this as completed Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants