Home / Function/ hasSelectionCapabilities() — react Function Reference

hasSelectionCapabilities() — react Function Reference

Architecture documentation for the hasSelectionCapabilities() function in ReactInputSelection.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  a96fa181_7474_eda8_7c38_1e173c424b26["hasSelectionCapabilities()"]
  61ae92ed_59ee_0d03_f7cc_6c7bd8c060f5["ReactInputSelection.js"]
  a96fa181_7474_eda8_7c38_1e173c424b26 -->|defined in| 61ae92ed_59ee_0d03_f7cc_6c7bd8c060f5
  4cfcf5ec_fe17_9b20_94a6_11e3787af2e1["getSelectionInformation()"]
  4cfcf5ec_fe17_9b20_94a6_11e3787af2e1 -->|calls| a96fa181_7474_eda8_7c38_1e173c424b26
  3ffa57aa_7550_476a_22f1_45c9f6827530["restoreSelection()"]
  3ffa57aa_7550_476a_22f1_45c9f6827530 -->|calls| a96fa181_7474_eda8_7c38_1e173c424b26
  ab574a65_e1cf_4bff_0d86_6d96e2a1fa23["getSelection()"]
  ab574a65_e1cf_4bff_0d86_6d96e2a1fa23 -->|calls| a96fa181_7474_eda8_7c38_1e173c424b26
  style a96fa181_7474_eda8_7c38_1e173c424b26 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-dom-bindings/src/client/ReactInputSelection.js lines 90–103

export function hasSelectionCapabilities(elem) {
  const nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  return (
    nodeName &&
    ((nodeName === 'input' &&
      (elem.type === 'text' ||
        elem.type === 'search' ||
        elem.type === 'tel' ||
        elem.type === 'url' ||
        elem.type === 'password')) ||
      nodeName === 'textarea' ||
      elem.contentEditable === 'true')
  );
}

Domain

Subdomains

Frequently Asked Questions

What does hasSelectionCapabilities() do?
hasSelectionCapabilities() is a function in the react codebase, defined in packages/react-dom-bindings/src/client/ReactInputSelection.js.
Where is hasSelectionCapabilities() defined?
hasSelectionCapabilities() is defined in packages/react-dom-bindings/src/client/ReactInputSelection.js at line 90.
What calls hasSelectionCapabilities()?
hasSelectionCapabilities() is called by 3 function(s): getSelection, getSelectionInformation, restoreSelection.

Analyze Your Own Codebase

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

Try Supermodel Free