MCPcopy
hub / github.com/codeceptjs/CodeceptJS / isNoElementFocused

Function isNoElementFocused

lib/helper/extras/focusCheck.js:7–12  ·  view source on GitHub ↗
(helper)

Source from the content-addressed store, hash-verified

5const EDITING_KEYS = new Set(['a', 'c', 'x', 'v', 'z', 'y'])
6
7async function isNoElementFocused(helper) {
8 return helper.executeScript(() => {
9 const ae = document.activeElement
10 return !ae || ae === document.documentElement || (ae === document.body && !ae.isContentEditable)
11 })
12}
13
14export async function checkFocusBeforeType(helper) {
15 if (!helper.options.strict && !store.debugMode) return

Callers 2

checkFocusBeforeTypeFunction · 0.85
checkFocusBeforePressKeyFunction · 0.85

Calls 1

executeScriptMethod · 0.45

Tested by

no test coverage detected