autofocus) is defined to work reliably only on during page load. It is not really suited for situations like swapping, or opening, or unhiding DOM elements such as in a single-page application framework. This attribute moves the focus to the specified input on page load. In this case #input is present in DOM but hidden; on clicking login button, the focus is removed.
You can check the issues at page https://bugs.chromium.org/p/chromium/issues/list if issue not find in it then report it .