Issue metadata
Sign in to add a comment
|
<input type="hidden"> values get reset between page navigation events
Reported by
christop...@gmail.com,
Jul 29 2017
|
||||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36 Steps to reproduce the problem: 1. load page with an <input type="hidden"> 2. set its value with JavaScript 3. navigate away 4. navigate back 5. access the element's value; it will now be reset What is the expected behavior? What went wrong? In Chrome 59, the value of the <input type="hidden"> was preserved between page navigations. It is not in Chrome 60. The value of <input type="text"> and <textarea> are correct. Did this work before? Yes Chrome 59 Chrome version: 60.0.3112.78 Channel: stable OS Version: OS X 10.11.6 Flash Version:
,
Jul 31 2017
An example HTML file that demonstrates the issue is included at the bottom of this comment. I have also attached it. In the example, I have also included an <input type="text"> element to demonstrate the expected behavior since other input types do not appear to have been affected by this regression (I have not tested them all). I don't really have the ability to do a screencast. Specific steps for this example: 1. open the file 2. type anything into the text input box 3. click link to navigate to google.com 4. click browser's back button 5. observe that the text input's value has been preserved but the hidden input's value has not been preserved I appreciate that this is a very rare corner case, but it is still a regression from Chrome 59 behavior. <!doctype html> <pre><code id="msg"><b>Message log</b><br></code></pre><br> type something here first --> <input type="text" id="text"></input><br> <input type="hidden" id="hidden"></input><br> then navigate away and then navigate back --> <a href="https://www.google.com">Google</a> <script> window.onload = function () { var hidden = document.getElementById("hidden"); var text = document.getElementById("text"); var msg = document.getElementById("msg"); msg.innerHTML += "<input type=\"text\"> value on load: " + JSON.stringify(text.value) + " <b>(when you navigate back, this should be whatever you typed below)</b>\n"; msg.innerHTML += "<input type=\"hidden\"> value on load: <span style='background:yellow;'>" + JSON.stringify(hidden.value) + "</span> <b>(when you navigate back, this <i>should</i> be \"foo\")</b>\n"; hidden.value = "foo"; msg.innerHTML += "<input type=\"hidden\"> value set after load by JS: " + JSON.stringify(hidden.value) + "\n"; }; </script>
,
Jul 31 2017
Thank you for providing more feedback. Adding requester "hdodda@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 31 2017
,
Aug 1 2017
This is a recent intentional behavior change; crrev.com/471669
,
Aug 1 2017
Alright. Thanks for the response. |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by hdodda@chromium.org
, Jul 31 2017Labels: Needs-Feedback