-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Dragging and dropping work on firefox but not on chrome #31
Comments
Can you provide a minimal test repo or an example at codesandbox.io? |
I can, hang on. |
Here you go: https://codesandbox.io/s/7ylzoylj10 |
Hey I can‘t find any drag and drop code in your example. 👀 |
What do you mean? I just copied your example over from https://github.com/heyscrumpy/tiptap/blob/master/examples/Components/Routes/Images/index.vue . Try opening the codesandbox on chrome and firefox and dragging and dropping an image from your machine onto the editor component (between Test & Text works best :) ). On firefox the image gets loaded into the editor component, but chrome just opens a new tab with the image you dropped (it navigates to the file address on your machine). PS: I'm using chrome 69.0.3497.100 |
Ah sorry, my fault 🙃 Hmm this is strange. Drop an image works fine on the official images example but not for your example on codesandbox. I'll check it out. |
Hey, it seems I stumbled over this exact same issue. I'm also using chrome build 69.0.3497.100 and experiencing the same behavior. The official image example does indeed work with chrome, but not when on localhost. Maybe it's something related to the build config of the examples page? I tried having a look, but couldn't find anything immediately obvious 😞 . |
I just noticed this issue also present on prosemirror, you can replicate the drag & drop behavior over at http://prosemirror.net/examples/dino/ . 🙃 So this is tehnically a ProseMirror issue not a TipTap issue. But what really baffles me is why it works on chrome on the official images example. |
@childonline Yeah super strange. Didn't find anything until yet. The demo page setup is indeed different because I don't use the tiptap packages from npm. Instead I added some alias with webpack to grab these packages directly from the src folders of the repository. But I don't think that's what makes the difference. |
I would bet that it has something to do with headers, origin, feature detection, accept, https or anything else linked to browser-server context. Chrome has lately a "dark" history for implementation of those things and breaking many previously working use cases. Of course, it is done in the name of "security" so nobody should complain. |
This is strange. In this sandbox I import a custom ImageNode extension (it's a copy from the image extension from tiptap-extensions) and it works fine. So it seems that something goes wrong in the build process? 🤷♂️ |
Yup, I can confirm, loading an identical "custom" ImageNode works on localhost aswell. |
This is fixed in |
thx, mate! |
Hello, I have the following single file component on top of which I drop an image:
`
Test Text
<script> import { Editor } from 'tiptap' import { HardBreakNode, HeadingNode, ImageNode, BoldMark, CodeMark, ItalicMark, } from 'tiptap-extensions' </script>
export default {
components: {
'editor': Editor,
},
data() {
return {
extensions: [
new HardBreakNode(),
new HeadingNode({ maxLevel: 3 }),
new ImageNode(),
new BoldMark(),
new CodeMark(),
new ItalicMark(),
]
}
}
`
The dragging and dropping of an image works on firefox , but not on chrome.
On chrome I receive a
Resource interpreted as Document but transferred with MIME type image/gif: "file:///home/mihaita/Pictures/giphy.gif".
warning and then the browser proceeds to navigate to the dropped filefile:///home/mihaita/Pictures/giphy.gif
;Any ideas what goes wrong?
The text was updated successfully, but these errors were encountered: