MCPcopy Create free account
hub / github.com/adearriba/ShopifyCheckoutJS / showError

Method showError

src/Components/Field.js:138–149  ·  view source on GitHub ↗

* Displays an error message for the field. * @param {string} message Error message to display

(message)

Source from the content-addressed store, hash-verified

136 * @param {string} message Error message to display
137 */
138 showError(message){
139 this.removeError();
140 this.classList.add(...this.classes.fieldError);
141
142 if(message && message.length > 0){
143 let errorElement = document.createElement('p');
144 errorElement.classList.add(...this.classes.fieldErrorMessage);
145 errorElement.innerHTML = message;
146
147 this.appendChild(errorElement);
148 }
149 }
150
151 /**
152 * Removes the errores for the field.

Callers

nothing calls this directly

Calls 1

removeErrorMethod · 0.95

Tested by

no test coverage detected