mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 13:53:40 -05:00
Allow Ctrl+Enter to start a compile while editing a table cell on macOS (#14940)
GitOrigin-RevId: 513affff5af4af9dd12cdb1d730c978e6bdac303
This commit is contained in:
parent
db76d1c316
commit
637788076a
1 changed files with 5 additions and 1 deletions
|
@ -18,6 +18,7 @@ import { useTableContext } from './contexts/table-context'
|
|||
import { useCodeMirrorViewContext } from '../codemirror-editor'
|
||||
import { undo, redo } from '@codemirror/commands'
|
||||
import { ChangeSpec } from '@codemirror/state'
|
||||
import { startCompileKeypress } from '@/features/pdf-preview/hooks/use-compile-triggers'
|
||||
|
||||
type NavigationKey =
|
||||
| 'ArrowRight'
|
||||
|
@ -144,8 +145,11 @@ export const Table: FC = () => {
|
|||
|
||||
const onKeyDown: KeyboardEventHandler = useCallback(
|
||||
event => {
|
||||
if (startCompileKeypress(event)) {
|
||||
return
|
||||
}
|
||||
const commandKey = isMac ? event.metaKey : event.ctrlKey
|
||||
if (event.code === 'Enter' && !event.shiftKey && !commandKey) {
|
||||
if (event.code === 'Enter' && !event.shiftKey) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
if (!selection) {
|
||||
|
|
Loading…
Reference in a new issue