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

Command icon 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:

Comments

eduardo morales alberti’s picture

Status: Active » Needs review
dtarc’s picture

This change works and seems like an improvement to me.

himanshu_jhaloya’s picture

Assigned: Unassigned » himanshu_jhaloya
StatusFileSize
new825 bytes

created patch please review

dtarc’s picture

StatusFileSize
new1.04 KB

Here's a patch for the change in #2. The patch in #5 doesn't match.

hchonov’s picture

Status: Needs review » Reviewed & tested by the community

We 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.

  • joseph.olstad committed 5247d6c1 on 4.0.x authored by dtarc
    Issue #3322946 by Eduardo Morales Alberti, dtarc, himanshu_jhaloya,...
joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed
eduardo morales alberti’s picture

I 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?

joseph.olstad’s picture

@Eduardo Morales Alberti,

Reattributed to you, thanks!

eduardo morales alberti’s picture

Thank you @joseph.olstad!!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

himanshu_jhaloya’s picture

Assigned: himanshu_jhaloya » Unassigned