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

Pressing Delete on an empty paragraph clears the node afterwards #2924

Closed
2 tasks done
rfgamaral opened this issue Jun 24, 2022 · 9 comments · Fixed by #3192
Closed
2 tasks done

Pressing Delete on an empty paragraph clears the node afterwards #2924

rfgamaral opened this issue Jun 24, 2022 · 9 comments · Fixed by #3192
Assignees
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@rfgamaral
Copy link
Contributor

rfgamaral commented Jun 24, 2022

What’s the bug you are facing?

This is better explained with a short demo:

firefox_4DBYnuFKvn

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

All of them. No special extensions.

How can we reproduce the bug on our side?

Use the default example editor, and replicate what you see in the GIF above.

What did you expect to happen?

Pressing Delete on an empty paragraph (or Shift + Backspace on macOS, I believe), should delete the empty paragraph where the text cursor is located (and not clear the node that comes afterwards).

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. 💖 (on behalf of Doist)
@rfgamaral rfgamaral added the Type: Bug The issue or pullrequest is related to a bug label Jun 24, 2022
@bdbch
Copy link
Contributor

bdbch commented Jun 26, 2022

Thanks, set the priority to high in our project board! Should definitely be fixed as soon as we get all those typing issues fixed.

@github-actions
Copy link
Contributor

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 github-actions bot added the Info: Stale The issue or pullrequest has not been updated in a while and might be stale label Aug 11, 2022
@rfgamaral
Copy link
Contributor Author

@bdbch This issue still exists, do you think this could be reopened, and possibly some attention?

@bdbch bdbch reopened this Sep 11, 2022
@bdbch bdbch added this to the 2.0.0 milestone Sep 11, 2022
@bdbch bdbch self-assigned this Sep 11, 2022
@bdbch
Copy link
Contributor

bdbch commented Sep 11, 2022

Hey @rfgamaral I'm looking into it now

@bdbch
Copy link
Contributor

bdbch commented Sep 11, 2022

It seems like it's not happening with all nodes. From what I've seen lists and blockquotes are effected, but code blocks and headlines stay the same.

@bdbch
Copy link
Contributor

bdbch commented Sep 11, 2022

It also seems like this bug is introduced by Prosemirror as it also happens on their examples site. I created an issue there: ProseMirror/prosemirror#1309

Would be nice if you could bump it. Is it okay for you if we close this issue and hope this problem gets resolved within Prosemirror? I'm not sure if we can intercept that behavior on our side.

@github-actions github-actions bot removed the Info: Stale The issue or pullrequest has not been updated in a while and might be stale label Sep 12, 2022
@rfgamaral
Copy link
Contributor Author

@bdbch Do you think this is something that you'll want to fix on Tiptap, or leave it as-is?

The current behaviour is not very common, and I couldn't find any other non ProseMirror based editors that would behave in the same way. IMO, pressing delete should delete the empty paragraph, and not "unwrap the node ahead".

@bdbch
Copy link
Contributor

bdbch commented Sep 13, 2022

As it seems this behaviour is intended by marijnh I'd say we should look into it again.
Do you think it should be configurable or should we change the "default" from Prosemirror on the editor behaviour here?

Also I think this happens for different types of nodes so we would need to do this handling for everything, right?

@rfgamaral
Copy link
Contributor Author

Do you think it should be configurable or should we change the "default" from Prosemirror on the editor behaviour here?

In a way, this is already configurable, by overriding the Delete keyboard shortcut.

So, if you want to keep the current behaviour the default, I can work around this on my side (although I'm having some difficulty finding out the right set of commands to run to achieve this). But IMO, a more natural and common behaviour would be to do this built-in

Also I think this happens for different types of nodes so we would need to do this handling for everything, right?

Not exactly sure what you mean, but tweaking the Delete keyboard shortcut should do the trick for all types of nodes.

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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants