mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-31 19:01:54 +02:00
Enable insert in the start of table cell (#1880)
* Enable insert in the beginning of table * Faster Return
This commit is contained in:
committed by
Ian Storm Taylor
parent
9fc8b1085a
commit
178fc78f1a
@@ -89,8 +89,12 @@ class Tables extends React.Component {
|
|||||||
const prevBlock = document.getClosestBlock(previous.key)
|
const prevBlock = document.getClosestBlock(previous.key)
|
||||||
|
|
||||||
if (prevBlock.type == 'table-cell') {
|
if (prevBlock.type == 'table-cell') {
|
||||||
event.preventDefault()
|
if (['Backspace', 'Delete', 'Enter'].includes(event.key)) {
|
||||||
return true
|
event.preventDefault()
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user