-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Bug with custom node view, selecting and dragging #1133
Comments
Sorry for the delay in testing this, just bumped everything up to the latest beta versions and whilst this is working better, its removing focus on the elements inside each block. To illustrate, I've updated my example sandbox - https://codesandbox.io/s/tiptap-issue-template-forked-z5rf7 - to include an input, which is what my (more detailed) custom node handles in a real-life scenario. I've added handling to the custom node to not simply clear the block when you start typing when a block node is selected - maybe that's part of the issue? This was working correctly before your change though. In any case, when you try to type in the input, you're unable to as the focus on the block seems to be taking priority. |
Hey @engram-design, there are some dependency issues at your codesandbox (some has changed in the last weeks for node views)
In addition, I think you misunderstood At the moment all clicks at inputs will be ignored by ProseMirror: Does that make sense to you? If not: what would you expect? |
Thanks for the heads up on the dependancy stuff, I should've kept a closer eye on those updates. That actually solves this issue, so sorry about bringing this up again! |
Sorry to keep posting, and this is slightly another topic, but still relevant. My use-case is being able to nest Tiptap editors - complex I know - which was working fine, but there's a slight hiccup with the focus logic in the latest beta's. I'm trying to hone in on exactly what's changed to be helpful. But, you can see what's going on in https://codesandbox.io/s/tiptap-issue-template-forked-z5rf7?file where I'm nesting two Tiptap editors, one is inside a custom Vue component. Try and click at the end of "Nested intro text" to add more text to this line and editor, and it'll shift the focus to the outer Tiptap editor. vrVodl.mp4The only way I can get it to select text is to select the text, which is probably tied to the drag logic. To provide some extra context, what this means for my use-case, is that I can no longer detect the focused state on nested editors, which I use for all sorts of things, but namely to show a floating menu. Here's a video of my actual issue in context. tLLG12.mp4Here, I'm trying to click on an empty line in an editor, which of course works fine for the outer editor, but for the nested one, its bubbling up to the outer editor. In earlier alpha versions, this wasn't an issue and was working correctly. Something just seems to be taking focus. |
Hey, I've added a patch to improve that behavior. |
But I just see that drag & drop is not yet running smoothly with nested editors. I’ll have to look at that again. |
@philippbosch Ah, perfect! Didn't think to suggest |
I've come across an issue when using custom node views for a node. There's strange behaviour with being unable to select a node, unless you click on the drag cursor first, then it becomes selectable.
To illustrate, refer to this sandbox code https://codesandbox.io/s/tiptap-issue-template-forked-z5rf7?file=/src/components/CustomNode.vue
I've also take a video to illustrate the behaviour. Note that you can't click on any of the nodes' text to select the node. But as soon as you click the drag cursor (you don't even have to move it) you can now select the nodes by clicking anywhere in the block, as would be expected initial behaviour.
Screen.Capture.on.2021-02-10.at.22-56-59.mov
The text was updated successfully, but these errors were encountered: