Why is the client-side validation triggered on every keypress when using the self asserted AD B2C page layout?

Patrick van Kleef 0 Reputation points

When using the selfasserted (2.1.20) page layout the clientside validation is triggered on every key press. It seems that the setting window.SETTINGS.inputVerificationDelayTimeInMilliseconds is not used?

If I inspect the source code there is only a delay of 50ms?

                    validateData: function(n) {
                        if (n = n || "",
                            setTimeout(function() {
                            }, 50);
                            return i.validateDataAsync()

The source code (https://login.woodgrovedemo.com/) looks different probably because an older version of the selfasserted is used?

                    validateInputWithDelay: function(n) {
                        var u = $(n)
                          , r = u.siblings("#api .error.itemLevel");
                        r !== null && r.html("");
                        this._timeout = setTimeout(function() {
                            i.isClaimValueValid(r, u.attr("id")) ? i.hideInlineError(r, u) : i.showInlineError(r, u)
                        }, t.config.inputVerificationDelayTimeInMilliseconds)

Is the delay intentionally removed? If yes, how can I implement a delay myself? Currently, when a user start typing an email address it shows an error message immediately (on the first letter).

enter image description here

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
14,891 questions
Azure Active Directory External Identities
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Mathur 15,071 Reputation points Microsoft Employee

    Hi @Patrick van Kleef ,

    Thanks for reaching out.

    Yes, this is expected behavior and has been introduced in 2.1.17 page layout version.

    User's image

    Enabling JavaScript in Azure AD B2C page enhances the UI experience. However, it is not recommended to update window.SETTINGS, window.CONTENT objects.

    As window.Settings is not storing objects in this version. You can add delay to this to introduce the delay.

    Reference: https://learn.microsoft.com/en-us/azure/active-directory-b2c/javascript-and-page-layout?pivots=b2c-user-flow

    Hope this will help.



    Please remember to "Accept Answer" if answer helped you.