Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
// COMPAT: Certain browsers don't handle the selection updates properly. In
// Chrome, the selection isn't properly extended. And in Firefox, the
// selection isn't properly collapsed. (2017/10/17)
if (Hotkeys.isMoveLineBackward(event)) {
event.preventDefault()
return editor.moveToStartOfBlock()
}
if (Hotkeys.isMoveLineForward(event)) {
event.preventDefault()
return editor.moveToEndOfBlock()
}
if (Hotkeys.isExtendLineBackward(event)) {
event.preventDefault()
return editor.moveFocusToStartOfBlock()
}
if (Hotkeys.isExtendLineForward(event)) {
event.preventDefault()
return editor.moveFocusToEndOfBlock()
}
// COMPAT: If a void node is selected, or a zero-width text node adjacent to
// an inline is selected, we need to handle these hotkeys manually because
// browsers won't know what to do.
if (Hotkeys.isMoveBackward(event)) {
event.preventDefault()
if (!selection.isCollapsed) {