mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 19:52:51 +00:00
15 lines
350 B
TypeScript
15 lines
350 B
TypeScript
export function isFormEvent(e: KeyboardEvent | MouseEvent) {
|
|
const t = e.target as HTMLFormElement;
|
|
if (!t) {
|
|
return false;
|
|
}
|
|
|
|
if (t.form || /^(INPUT|SELECT|TEXTAREA)$/.test(t.tagName)) {
|
|
return true;
|
|
}
|
|
if (/write/.test(window.getComputedStyle(t).getPropertyValue('-webkit-user-modify'))) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|