Using insertBefore can mess up auto-completing inputs
Reported by
amot...@jumptech.com,
Sep 27 2017
|
|||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Steps to reproduce the problem: 1. Set link path in page1.html to point to page2.html 2. Open page1.html in browser 3. Follow link to page2.html 4. Type "foobar" into first text input 5. Use browser back button to navigate to page1.html 6. Use browser forward button to navigate to page2.html What is the expected behavior? The text "foobar" should be auto-filled in the first text input. What went wrong? The text "foobar" is auto-filled in the second text input. Repeating steps 5 & 6 will show "foobar" alternating between the text inputs. Did this work before? N/A Does this work in other browsers? Yes Chrome version: 61.0.3163.100 Channel: stable OS Version: 4.4.0-96-generic Flash Version: This behavior only happens when using the browser back and forward buttons. Adding the attribute `autocomplete="off"` to the first text input stops this behavior.
,
Sep 28 2017
This same bug occurs even when line 12 of page2.html is changed to
```
var insertedNode = document.body.insertBefore(first, first)
```
The flip-flopping also happens when this is
```
var insertedNode
setTimeout(function() {
insertedNode = document.body.insertBefore(first, first)
})
```
except this time the console.log() on the next line logs `false`.
,
Sep 28 2017
,
Sep 28 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by hayato@chromium.org
, Sep 28 2017