tiptap icon indicating copy to clipboard operation
tiptap copied to clipboard

Backspacing through a nested list doesn't work properly

Open dilizarov opened this issue 2 years ago • 8 comments

What’s the bug you are facing?

When backspacing through a list and not starting at the last item, it clears the current item and the text of it's parent... but that is about it.

Video provided

https://www.loom.com/share/0dc205342dae40ecba2b73e715abf030

Which browser was this experienced in? Are any special extensions installed?

Version 99.0.4844.51 (Official Build) (x86_64)

How can we reproduce the bug on our side?

My video above demonstrates the bug.

This is done within your sandbox on tiptap.dev

Can you provide a CodeSandbox?

No response

What did you expect to happen?

I expect to naturally backspace through the list.

Anything to add? (optional)

No response

Did you update your dependencies?

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

Are you sponsoring us?

  • [X] Yes, I’m a sponsor. 💖

dilizarov avatar May 01 '22 20:05 dilizarov

@dilizarov I believe this is not an issue with tiptap as a product and potentially more as an issue with documentation. I have used nested lists several times and am able to backspace appropriately.

That said, I tried to recreate the error myself on the homepage and was unable to do so. Here is my own video for reference:

https://user-images.githubusercontent.com/41601975/166855981-03e0638e-f22e-4d36-8ace-d883178ee2a2.mp4

I held the spacebar for the first two levels and then started tapping for the next two. On both, it handled it just fine.

Did you try reloading the page/refreshing cache/restarting the browser?

pcbowers avatar May 05 '22 02:05 pcbowers

You're backspacing from the very last item

Notice in my video that I don't start from the very end of the list, but on a nested item somewhere in the middle of the list.

dilizarov avatar May 05 '22 20:05 dilizarov

Maybe this helps https://github.com/ueberdosis/tiptap/issues/2493

bkempe avatar May 05 '22 20:05 bkempe

@dilizarov I somehow missed that on your first comment! Thanks for clarifying.

pcbowers avatar May 05 '22 23:05 pcbowers

@bkempe Yeah, I think your issue is actually basically this.

I'm not sure I understand your workaround though - seems like a completely different text editor? I see it uses ProseMIrror under the hood though... Are you suggesting a ListItem extension plugin that handles backspacing like in your workaround?

I feel like that could work - but then I suppose I'll need to get OrderedList and BulletList to use the new extended listItem, yeah?

dilizarov avatar May 05 '22 23:05 dilizarov

Yes, you'd need some like

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

for TipTap and adjust the code in backspaceKeyCommand

bkempe avatar May 06 '22 06:05 bkempe

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[bot] avatar Jul 06 '22 20:07 stale[bot]

activity

bkempe avatar Jul 14 '22 09:07 bkempe

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

bkempe avatar Jan 14 '23 11:01 bkempe

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

github-actions[bot] avatar Apr 15 '23 00:04 github-actions[bot]

saw the bot closed this, but feels like it should stay open as its a bug, yeah? @bkempe just confirmed it is still a bug on the tiptap.dev main website editor.

dilizarov avatar Apr 25 '23 15:04 dilizarov

Anyone following this should follow #3128 and/or #3819 instead.

Nantris avatar Jun 11 '23 00:06 Nantris