mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-26 00:50:41 -05:00
fix: shortcuts conflict with browser native shortcuts
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// @ts-ignore
|
||||
import dom from '@packages/driver/src/dom'
|
||||
import $dom from '@packages/driver/src/dom'
|
||||
import events from './events'
|
||||
import appState from './app-state'
|
||||
import { action } from 'mobx'
|
||||
@@ -16,7 +16,10 @@ class Shortcuts {
|
||||
_handleKeyDownEvent (event: KeyboardEvent) {
|
||||
// if typing into an input, textarea, etc, don't trigger any shortcuts
|
||||
// @ts-ignore
|
||||
if (dom.isTextLike(event.target)) return
|
||||
const isTextLike = $dom.isTextLike(event.target)
|
||||
const isAnyModifierKeyPressed = event.altKey || event.ctrlKey || event.shiftKey || event.metaKey
|
||||
|
||||
if (isAnyModifierKeyPressed || isTextLike) return
|
||||
|
||||
switch (event.key) {
|
||||
case 'r': !appState.studioActive && events.emit('restart')
|
||||
|
||||
Reference in New Issue
Block a user