Home / File/ isTextInputElement.js — react Source File

isTextInputElement.js — react Source File

Architecture documentation for isTextInputElement.js, a javascript file in the react codebase. 0 imports, 2 dependents.

Entity Profile

Dependency Diagram

graph LR
  d1896f19_d30c_0443_48d3_c9e718f95b77["isTextInputElement.js"]
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7["ChangeEventPlugin.js"]
  ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 --> d1896f19_d30c_0443_48d3_c9e718f95b77
  b8a5c95d_02fb_4719_0efd_4463f2546996["SelectEventPlugin.js"]
  b8a5c95d_02fb_4719_0efd_4463f2546996 --> d1896f19_d30c_0443_48d3_c9e718f95b77
  style d1896f19_d30c_0443_48d3_c9e718f95b77 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

/**
 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
 */
const supportedInputTypes: {[key: string]: true | void, ...} = {
  color: true,
  date: true,
  datetime: true,
  'datetime-local': true,
  email: true,
  month: true,
  number: true,
  password: true,
  range: true,
  search: true,
  tel: true,
  text: true,
  time: true,
  url: true,
  week: true,
};

function isTextInputElement(elem: ?HTMLElement): boolean {
  const nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();

  if (nodeName === 'input') {
    return !!supportedInputTypes[((elem: any): HTMLInputElement).type];
  }

  if (nodeName === 'textarea') {
    return true;
  }

  return false;
}

export default isTextInputElement;

Domain

Frequently Asked Questions

What does isTextInputElement.js do?
isTextInputElement.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What files import isTextInputElement.js?
isTextInputElement.js is imported by 2 file(s): ChangeEventPlugin.js, SelectEventPlugin.js.
Where is isTextInputElement.js in the architecture?
isTextInputElement.js is located at packages/react-dom-bindings/src/events/isTextInputElement.js (domain: BabelCompiler, directory: packages/react-dom-bindings/src/events).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free