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

Backspace on parent items in nested lists does not work #2493

Open
2 tasks done
bkempe opened this issue Feb 7, 2022 · 23 comments
Open
2 tasks done

Backspace on parent items in nested lists does not work #2493

bkempe opened this issue Feb 7, 2022 · 23 comments
Assignees
Labels
Type: Bug The issue or pullrequest is related to a bug
Milestone

Comments

@bkempe
Copy link

bkempe commented Feb 7, 2022

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

  • foo
    • bar
      • baz

How can we reproduce the bug on our side?

Can 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?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@bkempe bkempe added the Type: Bug The issue or pullrequest is related to a bug label Feb 7, 2022
@bkempe
Copy link
Author

bkempe commented Feb 25, 2022

Workaround: https://github.com/bangle-io/bangle.dev/blob/master/components/base-components/list-item/commands.ts#L611
and

const ListItemFixed = ListItem.extend({
  addKeyboardShortcuts() {
    return {
      ...this.parent?.(),
      Backspace: () => backspaceKeyCommand(this.editor, this.name),
    };
  },
});
useEditor({
  extensions: [
    StarterKit.configure({
      listItem: false,
    }),
    ListItemFixed,
  ],
  // ...
});

@thecodrr
Copy link
Contributor

I can confirm this is still happening.

@stale
Copy link

stale bot commented Jul 29, 2022

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.

@stale stale bot added the stale label Jul 29, 2022
@svenadlung svenadlung removed the stale label Aug 1, 2022
@bdbch
Copy link
Contributor

bdbch commented Sep 14, 2022

Not stale - 100% an issue we should fix.

@bdbch bdbch added this to the 2.1.0 milestone Sep 14, 2022
@bdbch bdbch self-assigned this Sep 14, 2022
@rfgamaral
Copy link
Contributor

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 🤞

@bdbch
Copy link
Contributor

bdbch commented Sep 14, 2022

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.

@rfgamaral
Copy link
Contributor

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.

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.

@rfgamaral let us see what you're working on! Maybe we can get those issues resolved.

What do you mean?

@bdbch
Copy link
Contributor

bdbch commented Sep 14, 2022

Fixing this issue, along with #3128, and I don't want to push it

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.

@rfgamaral
Copy link
Contributor

Fixing this issue, along with #3128, and I don't want to push it

I thought you were fixing one of those issues and didn't want to push your changes haha.

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.

In general I think joining of nodes feels weird also when joining backwards.

Care to provide an example? Not sure what you mean by that.

@bkempe
Copy link
Author

bkempe commented Sep 14, 2022

Note that bangle (#2493 (comment)), https://github.com/YousefED/BlockNote and maybe also https://github.com/IncredibleDevHQ/Incredible have already solved this.

@bdbch
Copy link
Contributor

bdbch commented Sep 14, 2022

I guess you're talking about this here?
https://github.com/YousefED/BlockNote/blob/511cb65b707ca40289d838c71ac6edd29d882eef/packages/core/src/extensions/Blocks/nodes/Block.ts#L240

@YousefED you mind if we look into your solution for this issue?

@rfgamaral
Copy link
Contributor

@YousefED you mind if we look into your solution for this issue?

I'm sure it's fine...

image

😁

@rfgamaral
Copy link
Contributor

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 😎

@bdbch bdbch modified the milestones: 2.1.0, 2.0.0 Sep 14, 2022
@bdbch
Copy link
Contributor

bdbch commented Sep 14, 2022

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.

@bkempe
Copy link
Author

bkempe commented Jan 14, 2023

BTW, the behavior of Remirror is more intuitive than Bangle in backspacing on (nested) lists.

@bdbch bdbch modified the milestones: 2.0.0, 2.0.0 Release Feb 23, 2023
@bdbch bdbch modified the milestones: 2.0.0 Release, 2.1.0 Release Mar 28, 2023
@Nantris
Copy link
Contributor

Nantris commented May 23, 2023

@bkempe can you clarify the workaround you're recommending?? It's not clear what backspaceKeyCommand is in the context of your example and your link is now dead.

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.

@kalda341
Copy link

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.

@Nantris
Copy link
Contributor

Nantris commented May 23, 2023

I've found the problems with lists seem to be more extensive than I'd previously believed: #3128 (comment)

@Nantris
Copy link
Contributor

Nantris commented May 23, 2023

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.

@bdbch
Copy link
Contributor

bdbch commented Aug 4, 2023

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.

@bdbch
Copy link
Contributor

bdbch commented Aug 4, 2023

Right now I have tons of changes inside the 2.1.0-rc.x versions but I'm not sure if I want to even release this into 2.1.0 as this pretty much touches a lot of the core functionality of list behavior.

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.

@Nantris
Copy link
Contributor

Nantris commented Aug 5, 2023

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.

@bdbch
Copy link
Contributor

bdbch commented Aug 5, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue or pullrequest is related to a bug
Projects
Status: Triage Done
Development

No branches or pull requests

7 participants