ISSUE DESCRIPTION: *[MAJOR]* _functional_ @SsoReauth@.@handleSsoReauth@: @btnRelogin.focus()@ runs in @.then(...)@ of @reauthDialog.show()@, but the dijit Dialog is constructed with @autofocus: true@ and @refocus: true@ (p2j.js lines ~2001-2004). Dijit's autofocus uses a deferred focus pass that can run after the explicit @focus()@, fighting for and possibly cancelling focus on @btnRelogin@. Set @autofocus: false@ on the dojo Dialog when an explicit focus target is used, or move the focus call into the dojo @onShow@ hook. PROPOSED FIX: Add an optional @noAutofocus@ flag to the @ModalDialog@ constructor's @titleOption@ object (the existing options bag) and forward it as @autofocus: false@ to the dijit Dialog. Then in @p2j.sso_reauth.js@ pass @noAutofocus: true@ when constructing the dialog so dijit's deferred autofocus does not race the explicit @btnRelogin.focus()@. CHANGES: Before (lines 1925-1934): function ModalDialog(id, container, text, tooltip, hidden, titleOption) { var that = this; that.id = id; that.text = text; that.tooltip = tooltip; // if titleOption is omitted the title bar is displayed withot closed button that.noTitle = (titleOption && titleOption.noTitle) ? true : false; that.closable = (titleOption && titleOption.closable) ? true : false; After: function ModalDialog(id, container, text, tooltip, hidden, titleOption) { var that = this; that.id = id; that.text = text; that.tooltip = tooltip; // if titleOption is omitted the title bar is displayed withot closed button that.noTitle = (titleOption && titleOption.noTitle) ? true : false; that.closable = (titleOption && titleOption.closable) ? true : false; // Opt-out of dijit's deferred autofocus when the caller drives focus. that.noAutofocus = (titleOption && titleOption.noAutofocus) ? true : false; Before (lines 1994-2006): var dojoDialog = new Dialog( { id: that.id, className: "dialogFWDOverride", // It ensures screen readers announce the dialog content immediately // and allows users to start interacting with the dialog // without clicking it first autofocus: true, // This is essential for keyboard navigation, allowing users // to resume their workflow seamlessly after dismissing a dialog. refocus: true, closable: that.closable, }); After: var dojoDialog = new Dialog( { id: that.id, className: "dialogFWDOverride", // Callers driving their own focus target pass noAutofocus // to avoid dijit's deferred autofocus racing the explicit focus(). autofocus: that.noAutofocus ? false : true, // This is essential for keyboard navigation, allowing users // to resume their workflow seamlessly after dismissing a dialog. refocus: true, closable: that.closable, }); Before (lines 150-152): // -- Create modal dialog for the re-auth overlay -- reauthDialog = new p2j.ModalDialog('p2j-sso-reauth-dialog', document.body, '', '', true, {noTitle: true}); After: // -- Create modal dialog for the re-auth overlay -- // noAutofocus: drive focus to btnRelogin ourselves after show() resolves // (dijit's deferred autofocus would otherwise race the explicit focus call). reauthDialog = new p2j.ModalDialog('p2j-sso-reauth-dialog', document.body, '', '', true, {noTitle: true, noAutofocus: true});