MCPcopy Create free account
hub / github.com/Easy-Editor/EasyEditor / isFormEvent

Function isFormEvent

packages/plugin-hotkey/src/utils.ts:4–17  ·  view source on GitHub ↗
(e: KeyboardEvent | MouseEvent)

Source from the content-addressed store, hash-verified

2 * 检查事件是否由表单元素触发
3 */
4export const isFormEvent = (e: KeyboardEvent | MouseEvent) => {
5 const t = e.target as HTMLFormElement
6 if (!t) {
7 return false
8 }
9
10 if (t.form || /^(INPUT|SELECT|TEXTAREA)$/.test(t.tagName)) {
11 return true
12 }
13 if (t instanceof HTMLElement && /write/.test(window.getComputedStyle(t).getPropertyValue('-webkit-user-modify'))) {
14 return true
15 }
16 return false
17}

Callers 1

initFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected