Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Hitting "delete" on an empty slate block does not delete the block #172

Open
tisto opened this issue Oct 23, 2021 · 2 comments
Open

Hitting "delete" on an empty slate block does not delete the block #172

tisto opened this issue Oct 23, 2021 · 2 comments

Comments

@tisto
Copy link

tisto commented Oct 23, 2021

StR

  • as admin
  • create a new page
  • hit return on the title block to create a new empty slate block
  • hit delete (back on mac)
  • -> I'd expect the block to being deleted (like on draftJS)

Screenshot

Edit-Page (6)

@tiberiuichim
Copy link
Member

@tisto Weird, I've just tested on https://volto.kitconcept.dev/images/edit from Windows and this works. Maybe a MacOS quirk? I have a macbook somewhere, I'll see if I can replicate it there.

The "delete empty block" in slate only works if the next block is a slate block, as the operation is to "join with the next block".

if (data?.required || otherBlock?.required || otherBlock['@type'] !== 'slate')

This is in line with the delete operation in Word, most evident if you have some content on that line. I assume all text on that page was produced with slate?

@ichim-david
Copy link
Member

@tisto https://www.youtube.com/watch?v=wihPbB2KFvU

I've made a test on:
https://volto.kitconcept.com/edit
and https://volto.kitconcept.dev/edit

I've concluded that Draftjs at least on Ubuntu 20.04 with Firefox 93 behaves worse than Slate currently does
with regards to delete key behavior.

There are probably some delete behavior changes that we might want to make in order to ensure
that delete key works as you've mentioned but right now this is an universal issue and not only related
to Slate editor.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants