Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Date input with defaultValue regression in 15.2 #7233
On Chrome browser or webview on Android, an
I've tested on multiple devices, including tablets and phones. My phone has chrome/51.0.2704.81.
It works ok on Chrome desktop browser.
Additionally, if you tap the blank date field, and select the date which is what the defaultValue was set to, it leaves the field blank and no onChange event is triggered.
Inspecting the elements rendered on the Android device via chrome devtools, the 15.1 version renders as:
The 15.2 version renders with the value in the element:
This also affects
We had a similar issue setting value on controlled inputs of type="date" or type="time". It worked fine on desktop Chrome, but didn't display the value in iOS Chrome or Safari. We were getting events triggered and the value seemed to be set on the input, but not displayed.
Interestingly, when the page was rendered server side using ReactDOMServer, everything worked fine. But being rendered client side, no dice.
Downgrading from v15.2 to 15.1 fixed the problem.
Had to downgrade to 15.1.0 today because of something similar in mobile iOS and a datetime-local input with a controlled value. Basically the input would look empty until you change the value manually (even if it is putting it back to the same value). It looks like a bug at initialization.
Is it possible that this is a bug in Chrome for Android? Checkout this codepen:
The only way I can get it to display on Android is if I assign defaultValue after value. The other way around, it's like Chrome for Android is trying to be smart and only update the UI if the value changes.
referenced this issue
Aug 1, 2016
I seem to have an issue with this fix. In Chrome I get the following error when using an input type of color:
For some reason this fix seems to be removing my value. Please see the related StackOverflow post.
The error pointed me towards this particular issue number on GitHub.
Hi all; greeting from the Chromium team :). I ran across this bug when doing some web-compat work involving React, and filed http://crbug.com/838898 to get the underlying issue in Chromium fixed. I'm glad to report that tkent@ has now fixed it, and from 68.0.3432.0 onwards modifying defaultValue on Chrome Android should cause the UI to refresh.