MCPcopy
hub / github.com/autoNumeric/autoNumeric / clear

Method clear

src/AutoNumeric.js:3033–3044  ·  view source on GitHub ↗

* Reset the element value either to the empty string '', or the currency sign, depending on the `emptyInputBehavior` option value. * If you set the `forceClearAll` argument to `true`, then the `emptyInputBehavior` option is overridden and the whole input is clear, including any currency sign.

(forceClearAll = false)

Source from the content-addressed store, hash-verified

3031 * @returns {AutoNumeric}
3032 */
3033 clear(forceClearAll = false) {
3034 if (forceClearAll) {
3035 const temporaryForcedOptions = {
3036 emptyInputBehavior: AutoNumeric.options.emptyInputBehavior.focus,
3037 };
3038 this.set('', temporaryForcedOptions);
3039 } else {
3040 this.set('');
3041 }
3042
3043 return this;
3044 }
3045
3046 /**
3047 * Remove the autoNumeric data and event listeners from the element, but keep the element content intact.

Callers 2

constructorMethod · 0.80

Calls 1

setMethod · 0.95

Tested by

no test coverage detected