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

Trash icon should remove the whole block, not just delete the contents #449

Closed
etoledom opened this issue Dec 26, 2018 · 5 comments
Closed
Labels
[Type] Bug Something isn't working
Milestone

Comments

@etoledom
Copy link
Contributor

etoledom commented Dec 26, 2018

Reported by @iamthomasbishop

The issue happens when there is just one block in the canvas. When it is deleted with the trash icon, it will be replaced with an empty default (Paragraph) block block.

delete_last_block

Expected behavior:

When:

  • I have one block on the canvas – with or without content
  • I tap the remove/trash icon

Expect:

  • The canvas to be cleared, except for a placeholder block similar to what shows in the body when you start a new post
  • I’d expect the cursor to go to the title
@etoledom etoledom added the [Type] Bug Something isn't working label Dec 26, 2018
@etoledom etoledom added this to the Beta milestone Dec 26, 2018
@etoledom
Copy link
Contributor Author

etoledom commented Dec 26, 2018

I've been investigating this a bit further.

This is the behavior on Gutenberg Web:

default_web

What happens when the last block is removed, is that an instance of the paragraph block remains there, in the same way that happens in the mobile version.

The difference is that the paragraph block on web has a placeholder that has the same text than the initial default-block-appender (the label that is shown on a new post).

  • We could simulate further this behavior on mobile adding this placeholder. This will give the "illusion" that the last block was removed in the same way that in the web. This is the simplest way to go (I think) since is how Gutenberg web works.

  • Alternatively, we could branch out of the default web behavior and implement our own, showing the actual default-block-appender again. We might have to fight against Gutenberg's default behavior here, not sure if it would be a simple change or not.

@iamthomasbishop what do you think about the first option? Is your expectation based on the web behavior or are you actually thinking on a custom mobile behavior?

cc @koke @hypest

@koke
Copy link
Member

koke commented Dec 26, 2018

I’d expect the cursor to go to the title

I think I'd expect the keyboard to dismiss

@koke
Copy link
Member

koke commented Dec 26, 2018

I think there are some issues with the web behaviour, which I only noticed from your GIF 😁

When you delete the last block, you get the paragraph with a placeholder, but the placeholder isn't visible if the block is focused.

This block can't normally be deleted because the empty paragraph doesn't show the toolbar until you start typing. However, if you enable the top toolbar the block/formatting controls are still there, so yo can repeatedly remove that block and it looks like nothing happened (even the menu stays open).

I think adding the placeholder is still valuable, but as I mentioned to Thomas last week, we also don't want to copy this 😁

screen shot 2018-12-26 at 12 16 34

@hypest
Copy link
Contributor

hypest commented Dec 27, 2018

cc ...@hypest

I think we should move towards adding the full default block appender instead of the empty paragraph. Deleting the (single/only) block should dismiss the keyboard, plus add the default block appender.

@etoledom
Copy link
Contributor Author

Tested again and this is now solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants