MCPcopy
hub / github.com/autoNumeric/autoNumeric / _getFormAutoNumericChildren

Method _getFormAutoNumericChildren

src/AutoNumeric.js:3135–3142  ·  view source on GitHub ↗

* Returns an array of the AutoNumeric-managed elements for the given form element is passed, otherwise for the current `this.parentForm` element. * This search for elements, as well as contenteditable non-input tag ones. This also search for elements outside the `form` elements. *

(formElement)

Source from the content-addressed store, hash-verified

3133 * @private
3134 */
3135 _getFormAutoNumericChildren(formElement) {
3136 // Search for all the child AutoNumeric elements in that parent form
3137 const inputElementsList = [...formElement.elements]; //XXX `.elements` here only returns the form's inputs, not the other child elements that could be contenteditable
3138 const nonInputContentEditableElementsList = this._getContenteditableElements(formElement); // Get the contenteditable elements inside and outside the form element
3139 const elementsList = AutoNumericHelper.arrayUnique(inputElementsList, nonInputContentEditableElementsList);
3140
3141 return elementsList.filter(element => this.constructor.isManagedByAutoNumeric(element));
3142 }
3143
3144 /**
3145 * Returns an array of the non-input contenteditable elements linked to the given form element.

Callers 3

formMethod · 0.95
_onFormSubmitMethod · 0.95
_onFormResetMethod · 0.95

Calls 3

arrayUniqueMethod · 0.80

Tested by

no test coverage detected