@yuneta/gobj-ui 7.7.0 → 7.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gobj-ui.cjs.js +2 -7
- package/dist/gobj-ui.es.js +2 -7
- package/package.json +1 -1
- package/src/c_yui_form.js +10 -6
package/dist/gobj-ui.cjs.js
CHANGED
|
@@ -7493,13 +7493,8 @@ function field_validation_message($input) {
|
|
|
7493
7493
|
************************************************************/
|
|
7494
7494
|
function mark_field_validity($input) {
|
|
7495
7495
|
let $h = $input.parentNode ? $input.parentNode.querySelector(".help") : null;
|
|
7496
|
-
let
|
|
7497
|
-
|
|
7498
|
-
ok = $input.checkValidity();
|
|
7499
|
-
} catch (e) {
|
|
7500
|
-
ok = true;
|
|
7501
|
-
}
|
|
7502
|
-
if (ok) {
|
|
7496
|
+
let v = $input.validity;
|
|
7497
|
+
if (!v || v.valid) {
|
|
7503
7498
|
$input.classList.remove("is-danger");
|
|
7504
7499
|
if ($h) {
|
|
7505
7500
|
$h.textContent = "";
|
package/dist/gobj-ui.es.js
CHANGED
|
@@ -7488,13 +7488,8 @@ function field_validation_message($input) {
|
|
|
7488
7488
|
************************************************************/
|
|
7489
7489
|
function mark_field_validity($input) {
|
|
7490
7490
|
let $h = $input.parentNode ? $input.parentNode.querySelector(".help") : null;
|
|
7491
|
-
let
|
|
7492
|
-
|
|
7493
|
-
ok = $input.checkValidity();
|
|
7494
|
-
} catch (e) {
|
|
7495
|
-
ok = true;
|
|
7496
|
-
}
|
|
7497
|
-
if (ok) {
|
|
7491
|
+
let v = $input.validity;
|
|
7492
|
+
if (!v || v.valid) {
|
|
7498
7493
|
$input.classList.remove("is-danger");
|
|
7499
7494
|
if ($h) {
|
|
7500
7495
|
$h.textContent = "";
|
package/package.json
CHANGED
package/src/c_yui_form.js
CHANGED
|
@@ -1990,12 +1990,16 @@ function field_validation_message($input)
|
|
|
1990
1990
|
function mark_field_validity($input)
|
|
1991
1991
|
{
|
|
1992
1992
|
let $h = $input.parentNode? $input.parentNode.querySelector('.help') : null;
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1993
|
+
|
|
1994
|
+
/* `validity.valid`, NEVER `checkValidity()`.
|
|
1995
|
+
*
|
|
1996
|
+
* checkValidity() FIRES the `invalid` event, and this function is what
|
|
1997
|
+
* that event's handler calls: one asks the other for ever. It cost a
|
|
1998
|
+
* page full of "too much recursion" the first time Save reported a bad
|
|
1999
|
+
* field. Reading `validity` asks the same question and fires nothing.
|
|
2000
|
+
* A control with no `validity` (a wrapper div) is not invalid. */
|
|
2001
|
+
let v = $input.validity;
|
|
2002
|
+
let ok = !v || v.valid;
|
|
1999
2003
|
|
|
2000
2004
|
if(ok) {
|
|
2001
2005
|
$input.classList.remove('is-danger');
|