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

Allow pasting images with text alternatives #99

Merged

Conversation

oskarlh
Copy link
Contributor

@oskarlh oskarlh commented Oct 28, 2024

This fixes a bug where you sometimes can't paste images.

Example, without this fix:

Not.working.mov

Example, with this fix:

Working.mov

Verified in Firefox on MacOS and in Safari on iPhone (in Simulator).

@oskarlh
Copy link
Contributor Author

oskarlh commented Oct 28, 2024

The cause of the bug is that browsers sometimes include both a file item and a text item in the clipboard data, where the text item is an alternative text or a URL. So checking if items.length === 1 blocks the upload

@LogicAndTrick LogicAndTrick merged commit 1c0a6f3 into LogicAndTrick:master Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants