hasFormContent function

Last updated: 2026-03-04T23:21:38.393Z

Metrics

LOC: 24 Complexity: 9 Params: 1

Signature

hasFormContent(el: HTMLElement): : boolean

Summary

Checks if an element contains or is a form-related element

Source Code

function hasFormContent(el: HTMLElement): boolean {
  if (
    el.tagName === "INPUT" ||
    el.tagName === "SELECT" ||
    el.tagName === "TEXTAREA" ||
    el.tagName === "FORM"
  ) {
    return true;
  }

  if (
    el.classList.contains("ant-select") ||
    el.classList.contains("ant-form-item") ||
    el.className.includes("MuiFormControl") ||
    el.className.includes("react-select")
  ) {
    return true;
  }

  return (
    el.querySelector("input, select, textarea, .ant-select, .ant-form-item") !==
    null
  );
}

No outgoing dependencies.

Impact (Incoming)

graph LR hasFormContent["hasFormContent"] handleMutations["handleMutations"] handleMutations -->|calls| hasFormContent style hasFormContent fill:#dbeafe,stroke:#2563eb,stroke-width:2px click hasFormContent "a70353de2f735ffb.html" click handleMutations "b707db53be39a752.html"
SourceType
handleMutations calls