MCPcopy Create free account
hub / github.com/uiwjs/react-md-editor / canManipulateViaTextNodes

Function canManipulateViaTextNodes

core/src/utils/InsertTextAtPosition.ts:13–23  ·  view source on GitHub ↗

* @param {HTMLElement} input * @return {boolean}

(input: HTMLTextAreaElement | HTMLInputElement)

Source from the content-addressed store, hash-verified

11 * @return {boolean}
12 */
13function canManipulateViaTextNodes(input: HTMLTextAreaElement | HTMLInputElement): boolean {
14 if (input.nodeName !== 'TEXTAREA') {
15 return false;
16 }
17 if (typeof browserSupportsTextareaTextNodes === 'undefined') {
18 const textarea: HTMLTextAreaElement = document.createElement('textarea');
19 textarea.value = '1';
20 browserSupportsTextareaTextNodes = !!textarea.firstChild;
21 }
22 return browserSupportsTextareaTextNodes;
23}
24
25/**
26 * @param {HTMLTextAreaElement|HTMLInputElement} input

Callers 1

insertTextAtPositionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…