-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Cannot delete embeds with backspace #4299
Comments
Related: #4011 It is probably the case that the iframe for the embed is "eating" the keyboard event, since it has the focus. |
As reported in #6950 this is something impacts maybe beyond embed blocks and would be good to get the ability to delete. |
FWIW there is handling for Backspace/Delete keys in gutenberg/editor/components/block-list/block.js Lines 362 to 372 in 8e7682b
It is, however, scoped to keypresses which occur directly on the focusable block wrapper, not any inputs within. This is important, of course, since a user pressing backspace to delete a bit of text in a block's input shouldn't trigger the block to delete itself. In the case of #6950, I have a counter-argument: If I insert a URL then hold backspace to delete the entered text, should the block eventually delete itself? Or would this be unexpected behavior when my intention is simply to reset the input to an empty value? What are the blocks which fail these expectations? Can we enumerate them? To the original issue, I think we ought to close this as a combination of "works as intended" and "won't (can't) fix". "Works as intended" as in, when I insert an embed link and immediately press backspace, the block is deleted:
"Won't fix" as in, I'll make the claim that, due to same-origin policy, it is impossible to implement detection of a Backspace key event which occurs within an embed iframe, which is what I assume is meant by "select" in the original comment (i.e. clicking within the frame). Happy to be proven wrong here. With that in mind, I suggest we close the issue, and reopen if a proof-of-concept for iframe support can be demonstrated or we want to repurpose for other specific failing blocks. |
Issue Overview
Unlike other blocks, I cannot delete any embed blocks with the backspace/delete key.
Steps to Reproduce (for bugs)
Expected Behavior
Block should be deleted.
Current Behavior
Block is still there.
Possible Solution
Screenshots / Video
Related Issues and/or PRs
Todos
The text was updated successfully, but these errors were encountered: