1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-30 10:29:48 +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:
Jinxuan Zhu
2018-06-10 19:27:44 -04:00
committed by Ian Storm Taylor
parent 9fc8b1085a
commit 178fc78f1a

View File

@@ -89,8 +89,12 @@ class Tables extends React.Component {
const prevBlock = document.getClosestBlock(previous.key)
if (prevBlock.type == 'table-cell') {
event.preventDefault()
return true
if (['Backspace', 'Delete', 'Enter'].includes(event.key)) {
event.preventDefault()
return true
} else {
return
}
}
}