-
-
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
Impossible to place the cursor after a mark (bold, code, etc.) #2572
Comments
I'm assuming this is the default behavior, and that one can "exit" the mark by using a keyboard shortcut (or the toolbar buttons, if available). However, I don't think the |
Yes, this is a problem, but I don't know yet in which scope we want to solve this problem. Just adding keyboard shortcuts for this could be enough, but it also helps to show this visually with another cursor. That is rather hacky though. |
Keyboards shortcuts already work to "leave the mark", so it's not so bad as I originally thought. It would be nice to have something like that for all marks, built-in, and less hacky. But I understand it might be tricky to implement. Thanks for getting back to me on this, and hopefully you folks will be able to improve this in the future 👍 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@bdbch This issue still exists, and it's a very annoying one, can we reopen it, and keep it tracked? Although workarounds exists for some marks, I don't think it's possible to exit an inclusive link mark. This is a very annoying issue for us, and that's why we have |
I've reopened this issue and added it to our tracker. Thanks for pinging @rfgamaral |
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days |
bump |
Same issue here |
Any update on this? |
Sadly not. I didn't had time to get to this issue yet. |
I think I've seen other editors handle this (though, usually semi-buggy..) by using the right key to "break free" from the mark. I think this has only been active when there's nothing to the right of the mark[1]. Eg.: [1] which make sense, since if there's something there you can usually just move until you're outside the mark. |
I'm currently experimenting with an interesting solution using zero-width characters: addKeyboardShortcuts() {
return {
'Mod-e': () => this.editor.commands.toggleCode(),
// right arrow
'ArrowRight': () => this.editor.commands.command(({ tr }) => {
tr.removeStoredMark(this.type)
// Insert zero-width character to escape the mark
tr.insertText('\u200B', tr.selection.from, tr.selection.to)
return true;
}),
}
}, An advantage of this approach is we don't have to "simulate" a separate cursor. Now the tougher question is how can we strip out this zero-width character. Maybe I could create some pseudo-node that removes itself whenever content is added to it and insert that instead... I'll try and mess around with this more when I have the time |
What’s the bug you are facing?
When a mark, such as block, code, etc, is at the end of a paragraph, it's impossible to place the cursor after said mark. Here's a demo with the official Code example:
How can we reproduce the bug on our side?
See the demo above 👆
Can you provide a CodeSandbox?
n/a
What did you expect to happen?
One should always be able to type anything after a mark, even if it's the last mark on a paragraph.
Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: