ianstormtaylor / slate

A completely customizable framework for building rich text editors. (Currently in beta.)
http://slatejs.org
MIT License
29.97k stars 3.25k forks source link

Delete key behaves more like backspace when selected block is empty #1457

Closed cameracker closed 6 years ago

cameracker commented 6 years ago

Do you want to request a feature or report a bug?

Bug

What's the current behavior?

When the selection is on an empty block, the delete key behavior is more like backspace.

This causes an odd behavior where the cursor moves to the previous sibling when delete key is pressed instead of staying at the same block. Additionally, delete does not promote the content next sibling block to the current selected block as expected.

http://recordit.co/cBMAOQVAr8

What's the expected behavior?

Expected behavior is that delete key always maintains current block selection.

Nantris commented 6 years ago

This can be reproduced on any of the live examples: http://slatejs.org/#/rich-text

zGrav commented 6 years ago

I am not being able to replicate this on a empty block even on the demo, weird

cameracker commented 6 years ago

Reproduces in Firefox, Chrome, and Edge.

zGrav commented 6 years ago

Interesting, opening the demo on Chrome 62 on OS X, I am not being able to reproduce it

Edit: http://recordit.co/1U6CkmvxVD

cameracker commented 6 years ago

http://osxdaily.com/2013/04/26/delete-key-mac-forward-del/

The delete key on a Mac keyboard functions like a backspace key on a Windows/PC keyboard, deleting a character a time backwards from where the cursor is located.

On windows, the delete is a forward delete, so this is doing the wrong thing.

zGrav commented 6 years ago

Aha, I see. Sneaky OS X...

zGrav commented 6 years ago

Fixed, I believe.