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:
parent
9f2edf9512
commit
e0fa49315a
@ -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') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user