Re: [w3c/editing] Should deleting cell's content on a table inside a contenteditable area implies the whole table to be deleted ? (#163)

The execCommand spec states the following when specifying the behavior of "delete command":

https://w3c.github.io/editing/execCommand.html
> Tables are a notable special case. If an entire table is contained in the range, it will be deleted. If it's anything less, only the contents of the cells will be deleted and the table structure will be left intact.

I think this can be applied when deleting content from the cursor/caret position. Hence, independently on the number of cells or which one the cursor is placed on, the command should only delete the cell's content.

I think that is agreed, at least most of browser either implement it that way or have bugs to do so, that hitting backspace after a table (in the same line) will select the whole table so next backspace hit will delete the whole table. I think that behavior is clearer and more explicit of what the user intended to do.

Deleting the table when the user hit backspace on the last character of the first cell would lead to an unexpected behavior. The user might have hit backspace continuously or an excessive number of times, just to be sure the whole cell's content is deleted, but didn't want actually to delete the table itself. 

Deleting the table when hitting backspace on the last character in the second cell would make even less sense, IMHO. We can agree on moving the cursor to the previous cell, and eventually, if we want, delete the table when reaching the first cell if the table gets empty.  

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/163#issuecomment-308054937

Received on Tuesday, 13 June 2017 09:08:53 UTC