Comparing version 3.1.1 to 3.1.2
@@ -149,3 +149,3 @@ var __extends = (this && this.__extends) || (function () { | ||
if (error) | ||
inputProps.className += " user-invalid"; | ||
inputProps.className = (inputProps.className ? inputProps.className + " " : "") + "user-invalid"; | ||
if (el) | ||
@@ -152,0 +152,0 @@ el.setCustomValidity(typeof error === 'string' ? error : ""); |
{ | ||
"name": "holders", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "A tiny library to help you construct React user interfaces quickly & easily", | ||
@@ -5,0 +5,0 @@ "main": "elements", |
@@ -142,4 +142,4 @@ Holders: speak easy to your components | ||
validation) is offloaded to the browser as much as possible, and styling is left up to | ||
CSS (see demo.css for example styling). The browser validation API was designed very | ||
badly, though, so this library augments the built-in support. | ||
CSS (see demo.css for example styling). The standard browser validation API was designed | ||
very badly, though, so this library augments the built-in support. | ||
@@ -156,3 +156,3 @@ Validation support | ||
If the Holder Forms component is text-based (TextBox or TextArea), it will notify the element that it is invalid using the `setCustomValidity` API, and then you can style it with a selector like `input[type="text"]:invalid`. | ||
If the Holder Forms component is text-based (TextBox or TextArea), it will notify the element that it is invalid using the `setCustomValidity` API, and then you can style it with a selector like `input[type="text"]:invalid` or `.user-invalid`. The `user-invalid` class will appear on elements that have a validation error after the user has interacted with them. Typically it is applied when the element loses focus (see the documentation of `showErrorEarly` in `TextAttributesBase` for exceptions to this rule). | ||
@@ -172,3 +172,3 @@ Since validation support sucks ass in most browsers, the component produces extra HTML for validation errors. For example, consider this humble component: | ||
<span class="inputspan"> | ||
<input required="" autocomplete="name" placeholder="First Last" type="text" value=""> | ||
<input required="" autocomplete="name" placeholder="First Last" type="text" value="" class="user-invalid"> | ||
<span class="errorspan">Please fill out this field.</span> | ||
@@ -175,0 +175,0 @@ </span> |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
93443
0