-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Backspace on parent items in nested lists does not work #2493
Comments
Workaround: https://github.com/bangle-io/bangle.dev/blob/master/components/base-components/list-item/commands.ts#L611 const ListItemFixed = ListItem.extend({
addKeyboardShortcuts() {
return {
...this.parent?.(),
Backspace: () => backspaceKeyCommand(this.editor, this.name),
};
},
});
useEditor({
extensions: [
StarterKit.configure({
listItem: false,
}),
ListItemFixed,
],
// ...
}); |
I can confirm this is still happening. |
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. |
Not stale - 100% an issue we should fix. |
Fixing this issue, along with #3128, and I don't want to push it 😅, but also with #3192, will eliminate sooooooo many paint points for us and our users, that you have no idea. I'm biased, of course, but I believe that fixing all those 3 issues will make the editor much more stable and provide a less painful writing experience. Here's hoping you can prioritize these 🤞 |
Thats true. I think while Prosemirror may provide their own solutions for specific editor behaviors, most people want the editor to behave like the most basic ones like Google Docs. @rfgamaral let us see what you're working on! Maybe we can get those issues resolved. |
Completely agree, most people expect things to behave more or less the same everywhere, and things like Google Docs or Dropbox Paper are probably the de facto tools for writing on the Web.
What do you mean? |
I thought you were fixing one of those issues and didn't want to push your changes haha. Misunderstanding there. I'll see what I can do with my PR regarding empty nodes and node forward joining. Maybe this will fix some weird behaviours. In general I think joining of nodes feels weird also when joining backwards. |
Ahah, no, I just meant that I didn't want push for you to fix everything at the same time, but I feel all those issues are connected in the sense that when fixed, the editor behaviours will be more in line with that people expect.
Care to provide an example? Not sure what you mean by that. |
Note that bangle (#2493 (comment)), https://github.com/YousefED/BlockNote and maybe also https://github.com/IncredibleDevHQ/Incredible have already solved this. |
I guess you're talking about this here? @YousefED you mind if we look into your solution for this issue? |
I'm sure it's fine... 😁 |
Did a quick test around BlockNote, and that implementation seems to provide a better backspace handling for this issue and also #3128. Hopefully you can draw inspiration from that, and fix two issues in one go 😎 |
I'll look into that! Moved this ticket into the 2.0.0 Milestone too as I think the editor behavior should be fixed when we go stable. |
BTW, the behavior of Remirror is more intuitive than Bangle in backspacing on (nested) lists. |
@bkempe can you clarify the workaround you're recommending?? It's not clear what I assume like shown here? https://github.com/bangle-io/bangle.dev/blob/22491acc0e7e3a8ed98bde4e217a2d4d87563eeb/components/base-components/src/list-commands.ts#L620 PS: Is this actually planned for 2.1.0? It really doesn't seem like it. |
I too would like to know if it's going to land in 2.1.0. It's something our customers have been wanting fixed for a while now, and it would be great to be able to update them on when that's likely to happen. |
I've found the problems with lists seem to be more extensive than I'd previously believed: #3128 (comment) |
Based on this comment I think 2.1.0 release will definitely not resolve any of these issues. It was mentioned it would be in 2.1.0-rc.1 due to how dangerous it is to release, and so the next possible window would be 2.2.0-rc.1 which isn't even being discussed yet. |
After dabbling a lot inside lists and trying to get the behavior users would expect I think this is an issue that maybe should moved upstream to Prosemirror. I think this will eventually effect every liftable item that can be nested - not only lists. |
Right now I have tons of changes inside the I'm currently discussing with the team if we keep my changes and release them with 2.1.0 or we keep them out and lift this up to Prosemirror and try to help out there to get better list behavior. In the case that Marjin is not agreeing with changing List behavior we would be a bit bottlenecked there. |
From my reading (a lot) I strongly suspect marijnh is not open to further modifying the behavior of lists in ProseMirror. That's unfortunate but somewhat understandable given what we're all experienced trying to get lists working nicely. I don't think he wants to find himself bogged down in the particularities of list behaviors. As we are finding, it's a rough time. Slate by ianstormtaylor, for example, doesn't even endeavor to implement indentable lists, to my knowledge. It's handled entirely with additional packages. |
Maybe I'll strip out those extra keymaps into an extra package then. This way the vanilla lists will behave like Prosemirror but we can work on fixing them on an additional level. I'll still try to get in touch with Marjin regarding this. |
What’s the bug you are facing?
TipTap/Prosemirror behaves a bit UX-unfriendly out of the box when one attempts to delete foo or bar alone in a nested bullet structure like
How can we reproduce the bug on our side?
bar
and press backspace.foo
disappears, but nothing else happensCan you provide a CodeSandbox?
No response
What did you expect to happen?
Lines joining, e.g. behavior similar to https://h9xxi.csb.app/, https://remirror.io/, or https://app.bangle.io/
Anything to add? (optional)
Maybe related https://discuss.prosemirror.net/t/joinbackward-behavior/3296/8
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: