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

Do not remove previous block on backspace #530

Merged
merged 1 commit into from
Apr 28, 2017

Conversation

nylen
Copy link
Member

@nylen nylen commented Apr 27, 2017

This quick PR is a follow-up to discussion at https://github.com/WordPress/gutenberg/pull/461/files#r112692639. When testing out the Backspace-to-merge behavior introduced there, I was pretty surprised to learn that pressing Backspace at the beginning of a text block will delete the previous block in a lot of cases (an image/gallery block, for example).

I think it's pretty unlikely that this would be the intended result of such an operation. In general it should be much more difficult to delete blocks, and it should require an explicit action from the user (I don't think the controls for this exist yet).

Let's go back to the other alternative discussed in that comment thread (do nothing) until we provide a better way to remove blocks.

@youknowriad
Copy link
Contributor

I think it'd be good to have @jasmussen thoughts on this.

@jasmussen
Copy link
Contributor

Let's unpack this.

Keeping in mind we want to compare the single paragraph vs. multi paragraph text blocks (#513), we might want different things here. For a multi paragraph text block we might want to enforce the cross-block boundaries more, whereas in a single paragraph text block world we might enforce them only for non-text blocks.

In both cases I do agree, we probably don't want you to be able to backspace from the beginning of a text block into an image block and delete it.

We do know that we want it to be easy to delete blocks like an image intentionally. So far I've imagined selecting the image and pressing backspace or delete. Either that's enough or we also want an explicit delete button (#130).

Depending on where 513 takes us (i.e. after we decide), would it be possible to revisit this? If we go with a single paragraph text block, for instance, we'll probably want to let backspace merge paragraphs and such.

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is easy to change one way or another, feel free to merge this 👍

@mtias mtias added the [Type] Bug An existing feature does not function as intended label Apr 28, 2017
@mtias
Copy link
Member

mtias commented Apr 28, 2017

Related #542

@nylen
Copy link
Member Author

nylen commented Apr 28, 2017

for instance, we'll probably want to let backspace merge paragraphs and such.

I'm totally fine with this sort of thing, I just think it should be an explicit opt-in per block, and only for the cases that we've specifically tested and know we can handle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants