I implemented a login widget on this site I'm working on and I noticed that if the login widget is below the fold, when the page loads it automatically scrolls down the page so the email field can be visible. It's quite annoying, it seems that some javascript is getting added to the bottom of the page, but I can't seem to find where its coming from. I've. Looked through tons of files to see where its getting added in, but no luck. Need help please.
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
This focus is probably coming from MemberLoginForm.php. Has something like
Requirements::customScript(<<<JS
(function() {
var el = document.getElementById("MemberLoginForm_LoginForm_Email");
if(el && el.focus) el.focus();
})();
JS
);
Which looks like it would focus it. Only way to disable that it looks like is setting the javascript validation handler to none.
OMG, they really hid that, I've been looking for that file FOREVER!
I had to do a search of entire local site in dreamweaver. Its in sapphire/security/MemberLoginForm.php
I can just comment that out, right?
Thanks Man!
REally Appreciate it.