Problem/Motivation
Reading https://www.drupal.org/node/3158256, on document and window should not be used the events directly on it.
Example old way:
$(document)
.once('off-canvas')
.on();
Example new way:
// Can not use `window` or `document` directly.
if (!once('off-canvas', 'html').length) {
// Early return avoid changing the indentation
// for the rest of the code.
return;
}
$(document).on();
Proposed resolution
Refactor the clientside validation javascript to follow the change record
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | clientside_validation-3322946-6.patch | 1.04 KB | dtarc |
| #5 | 3322946-1.patch | 825 bytes | himanshu_jhaloya |
Issue fork clientside_validation-3322946
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3322946-once-is-not
changes, plain diff MR !9
Comments
Comment #3
eduardo morales albertiComment #4
dtarc commentedThis change works and seems like an improvement to me.
Comment #5
himanshu_jhaloya commentedcreated patch please review
Comment #6
dtarc commentedHere's a patch for the change in #2. The patch in #5 doesn't match.
Comment #7
hchonovWe had an issue with the webform module client validation where our errors started using the label tag instead of the strong one and then the errors were overlapping the label of the input fields. This patch solved the issue for us, therefore I think it is good to go.
Comment #9
joseph.olstadComment #10
eduardo morales albertiI did a diff from the patch #6 https://www.drupal.org/files/issues/2023-01-25/clientside_validation-332... and from the MR that I created https://git.drupalcode.org/project/clientside_validation/-/merge_request... and there is no difference.
Why the MR was not merged and instead of it the authority was given to a user that copied the MR patch?
Comment #13
joseph.olstad@Eduardo Morales Alberti,
Reattributed to you, thanks!
Comment #14
eduardo morales albertiThank you @joseph.olstad!!
Comment #17
himanshu_jhaloya commented