Skip to content

Commit c8c656a

Browse files
committed
maint(pat-validation): Use more debug messages.
1 parent 9ed77c8 commit c8c656a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/pat/validation/validation.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export default Base.extend({
5858
for (const [cnt, input] of this.inputs.entries()) {
5959
// Cancelable debouncer.
6060
const debouncer = utils.debounce((e) => {
61+
logger.debug("Checking input for event", input, e);
6162
this.check_input({ input: input, event: e });
6263
if (this.disabled_elements.some((it) => it.disabled)) {
6364
// If there are already any disabled elements, do a check
@@ -100,6 +101,7 @@ export default Base.extend({
100101
// Immediate, non-debounced check with submit. Otherwise submit
101102
// is not cancelable.
102103
for (const input of this.inputs) {
104+
logger.debug("Checking input for submit", input, e);
103105
this.check_input({ input: input, event: e });
104106
}
105107
}
@@ -206,12 +208,15 @@ export default Base.extend({
206208
}
207209

208210
// always check the other input to clear/set errors
209-
!stop && // do not re-check when stop is set to avoid infinite loops
210-
not_after_el &&
211+
// do not re-check when stop is set to avoid infinite loops
212+
if (!stop && not_after_el) {
213+
logger.debug("Check `not-after` input.", not_after_el);
211214
this.check_input({ input: not_after_el, stop: true });
212-
!stop &&
213-
not_before_el &&
215+
}
216+
if (!stop && not_before_el) {
217+
logger.debug("Check `no-before` input.", not_after_el);
214218
this.check_input({ input: not_before_el, stop: true });
219+
}
215220
}
216221

217222
if (!validity_state.customError) {
@@ -362,6 +367,7 @@ export default Base.extend({
362367
if (!it.disabled) {
363368
it.setAttribute("disabled", "disabled");
364369
it.classList.add("disabled");
370+
logger.debug("Disable element", it);
365371
}
366372
}
367373
},

0 commit comments

Comments
 (0)