mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-13 04:03:07 +00:00
15 lines
378 B
TypeScript
15 lines
378 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 (t instanceof HTMLElement && /write/.test(window.getComputedStyle(t).getPropertyValue('-webkit-user-modify'))) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|