active-directory-b2c-custom-policy-starterpack
active-directory-b2c-custom-policy-starterpack copied to clipboard
Support focus on the first attribute (HTML input element) - urn:com:microsoft:aad:b2c:elements:selfasserted:1.1.0
Content definitions (TrustFrameworkPolicy element "ContentDefinition") with DataUri="urn:com:microsoft:aad:b2c:elements:selfasserted:1.1.0" do not set the focus on the first attribute (HTML input element for claim).
Only the content definiton with DataUri="urn:com:microsoft:aad:b2c:elements:unifiedssp:1.0.0" contains a useful focus setting.
Because own JavaScript is filtered out, this should be fixed rapidly. Otherwise we have to inform the users that they must press TAB or use mouse.
Please fix this problem asap. It is one line JavaScript/jQuery
$(document).ready(function() {
$('form:first *:input[type!=hidden]:first').focus();
});
OR (much easier)
A line similar to the following (marked with "/* FIX HERE */") for all attributes:
Handlebars.registerHelper('buildTextInput', function (id, type, placeholder, value, pattern, patternDesc, title, required, readonly, index, options) {
var input = '<input id="' + id + '" class="textInput" type="' + type + '" ';
var ariaLabel = "";
var passwordErrorMsgsStr = "";
/* FIX HERE */ input += 'autofocus '; // New line inserted
if (placeholder) {
input += 'placeholder="' + placeholder + '" ';
}
P. S.: Twice posted (other entry: https://github.com/Azure-Samples/active-directory-b2c-advanced-policies/issues/30) - please decide which repo is the right one.