mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 16:43:36 -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 { useCodeMirrorViewContext } from '../codemirror-editor'
|
||||||
import { undo, redo } from '@codemirror/commands'
|
import { undo, redo } from '@codemirror/commands'
|
||||||
import { ChangeSpec } from '@codemirror/state'
|
import { ChangeSpec } from '@codemirror/state'
|
||||||
|
import { startCompileKeypress } from '@/features/pdf-preview/hooks/use-compile-triggers'
|
||||||
|
|
||||||
type NavigationKey =
|
type NavigationKey =
|
||||||
| 'ArrowRight'
|
| 'ArrowRight'
|
||||||
|
@ -144,8 +145,11 @@ export const Table: FC = () => {
|
||||||
|
|
||||||
const onKeyDown: KeyboardEventHandler = useCallback(
|
const onKeyDown: KeyboardEventHandler = useCallback(
|
||||||
event => {
|
event => {
|
||||||
|
if (startCompileKeypress(event)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const commandKey = isMac ? event.metaKey : event.ctrlKey
|
const commandKey = isMac ? event.metaKey : event.ctrlKey
|
||||||
if (event.code === 'Enter' && !event.shiftKey && !commandKey) {
|
if (event.code === 'Enter' && !event.shiftKey) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
if (!selection) {
|
if (!selection) {
|
||||||
|
|
Loading…
Reference in a new issue