TextField type='date' does not display correctly on mobile
See original GitHub issueBefore creating a new issue, please confirm:
- I have searched for duplicate or closed issues and discussions.
- I have tried disabling all browser extensions or using a different browser
- I have tried deleting the node_modules folder and reinstalling my dependencies
- I have read the guide for submitting bug reports.
On which framework/platform are you having an issue?
React
Which UI component?
Other
How is your app built?
create react app
What browsers are you seeing the problem on?
Chrome, Microsoft Edge
Please describe your bug.
TextField does not display correctly on android chrome when type is date
the field becomes visually split into 3 rows
start, text, end
What’s the expected behaviour?
The field should display similarly to how it appears on a desktop ie on a single row
Help us reproduce the bug!
Bug can be seen in this minimal app https://main.d3nu6n3lsn8380.amplifyapp.com/
source at https://github.com/MigeBill/date-issue
Code Snippet
// Put your code below this line.
export function App() {
return (
<View>
<Text variation='primary'>amplify textfield date</Text>
<TextField type='date' label=''></TextField>
<Text>html input date</Text>
<input type='date'></input>
</View>
);
}```
### Additional information and screenshots
_No response_
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Date input doesn't show properly in Mobile - Stack Overflow
1. The appearance of the <input type="date"> varies between browsers. If you want it to look the same, you can either try to...
Read more >Date field is not displaying correctly in mobile view - Jotform
Hello,. In my form I am clicking the "Preview Form" button and am selecting the "Phone" view with the vertical (default) orientation.
Read more >input[type=date] with empty value shrunken height on mobile
On iPad, an input of type date that doesn't have any initial value appear smaller until touched or a date selected.
Read more >Date and time picker not showing on mobile phone
You have onfocus and onblur events available on both date and time input, and field type is changing from date to text on...
Read more ><input type="date"> - HTML: HyperText Markup Language
By default, <input type="date"> doesn't validate the entered value beyond its format. The interfaces generally don't let you enter anything that ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@hbuchel thanks, that work around is a great improvement 😃
@Anyone, minor typo in above workaround, closing ] is missing
@MigeBill Just an initial update, there is some difference with the display value for the native browser date picker between desktop and mobile. A sort of workaround (at least specific to Chrome) while we work on a fix is re-setting the display in some additional CSS like below:
Stackblitz example
It does not show the typical dropdown arrow like the native unstyled date picker does; or on desktop how it shows the native browser’s calendar icon. On our side, we need to make some decisions about how we treat the missing appearance.