2
When using the attribute multiple
, the page when loaded, scrolls to the last <select/>
containing a option
with the attribute selected
:
<p>No Google Chrome a página não fica aqui...</p>
<form style="padding-top:1000px;">
<p>No Google Chrome desliza para aqui...</p>
<select multiple="multiple">
<option selected="selected">1</option>
<option>2</option>
</select>
</form>
form{
padding-top:1000px;
}
<p>No Google Chrome a página não fica aqui...</p>
<form>
<p>No Google Chrome desliza para aqui...</p>
<select multiple="multiple">
<option selected="selected">1</option>
<option>2</option>
</select>
</form>
This same problem is also reported for Chromium although the indication is that it only appears in some versions:
- Issue 423256: Select Elements cause Automated scroll on page load
- Issue 426919: Page Scrolls to select with Multiple attribute on load if it contains a Selected option.
Question
How to get around this problem so that the website has the same behavior in all browsers?
Tests where the problem does not occur:
- Chromium Version 37.0.2062.120 Built on Ubuntu 14.04, running on Linuxmint 17 (64-bit)
- Mozilla firefox 32.0.3 for Linux Mint - Mint - 1.0
- Internet Explorer 11 - Version 11.0.9600.17351 - Update 11.0.13 running on Windows 8.1
Successfully playing the bug:
- Google Chrome - Version 38.0.2125.111 m running on Windows 8.1
Sorry to "resurrect" the question, I was reviewing some unanswered questions and I came across yours, I could not reproduce the problem, tell me it still occurs? (version 39) Another thing my Windows is x64, your Windows is on a virtual machine (probably x86)?
– Guilherme Nascimento
@Guilhermenascimento You did well, I have found a solution to overcome the problem, I will have to come up with an answer with it. As of today, I do not know if the problem still exists. I will give feedback as soon as possible on the subject.
– Zuul