1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-24 17:23:07 +01:00

Fix examples/tables variable "previous" is null when select text and delete all (#2638)

This commit is contained in:
董沅鑫 2019-03-09 01:04:54 +08:00 committed by Ian Storm Taylor
parent 9f2edf9512
commit e0fa49315a

View File

@ -163,6 +163,11 @@ class Tables extends React.Component {
if (isCollapsed && start.isAtStartOfNode(startNode)) {
const previous = document.getPreviousText(startNode.key)
if (!previous) {
return next()
}
const prevBlock = document.getClosestBlock(previous.key)
if (prevBlock.type === 'table-cell') {