Thank you for your suggestion. But we do need to disable any focus, the reason is we are using Pega Web Mashup included in a host application page. When refreshing the window, default focus transfer to the part of Mashup part instand of the top of the host page.
It might be possible that the focus is getting set in the file "pega_yui_container". Can you try to put "debugger;"(without quotes) at various places in this file and can debug to find exactly where the focus is getting set.
Thanks for you all sugestions. It seems setting the first element focus has been coded as a part of final rule and can not be modified easly.
And I have tried to add a focus to a hidden text input but it does not work, also disable and invisble elements can no be the target of focus also.
So I finnaly added a small blank icon at the top of our Mashup UI and set focus on it by customize JQuery code and it works. But I think it is not the best practice to resolve it, if anyone has idea around this please share it with us, thank you
The issue here is when the page loads the order of dom execution finds where the focus need to happen. Since you have mashup code which gets loaded in the iframe the elements are evaluated based on the where the first interactive elements it present and tabindex. We are trying to intercept the normal behavior to accomplish something differently which complicates. Let me know if you find a better solution!