Label is overlapping with date selector
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
- Start Bank setup flow
- Reach a step that requires entering a date
Expected Result:
Selector and label should not overlap
Actual Result:
Selector and label are overlapping
Workaround:
None needed, visual issue.
Platform:
Where is this issue occurring?
- Web
- iOS
- Android
- Desktop App
- Mobile Web
Version Number: Main build
Reproducible in staging?: No, issue is in Main Reproducible in production?: No
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Expensify/Expensify Issue URL:
Issue reported by: @marcaaron Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1633367592384900
Triggered auto assignment to @TomatoToaster (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
It looks like this is fixed on the latest main branch for me. I know @marcaaron mentioned it was happening for you on main can you confirm if it's fixed now?

I know @marcaaron mentioned it was happening for you on main can you confirm if it's fixed now?
1000% still happening. Try using a mobile user agent in Safari or Chrome?

Try using a mobile user agent in Safari or Chrome?
Although it would reproduce the bug, the datepicker would not be rendered like that on the actual Safari on an iPhone
The bug is related to the browser window width. It would only happen if you intentionally use too small width on a desktop browser
On the actual mobile browser the field is rendered like this


To reproduce the bug shrink the browser window to be less than 800px
The content mm/dd/yyyy is rendered only on desktop and web.
It's special content (not a value or a placeholder), rendered for native date inputs (input type=date)
On these platforms the user has the option to input the date by typing (or using arrows, mouse scroll, as well as from a picker popup)
On mobile web - users are presented with a picker after they focus a date field. They can't input the date by typing so they don't see a date pattern hint inside the field
The implementation for the DatePicker tries to render the label in the active state when we're on a larger screen https://github.com/Expensify/App/blob/817240d823d4872a4fff7034567d01994b6f1264/src/components/DatePicker/index.js#L76-L78
I have searched and haven't found a way to know that a pattern like mm/dd/yyyy would be displayed besides knowing that if we don't have a value and we're on desktop the patter will be displayed so we need to move up the label
IMO we have a few options:
- The web/desktop picker might be re-implemented: https://expensify.slack.com/archives/C01GTK53T8Q/p1633013785293700 if we're not using input
type=datethis won't be a problem or will be handled differently - Change the test for
forceActiveLabelto be based on the current device supporting touches. We assume a touch based device is mobile - Always render the label moved up -
forceActiveLabel=truefor the DatePickers
Ok I think we should probably just do nothing because as you pointed out this really only affects mobile web browsers IN a desktop platform. That's not really going to affect anyone except us when we're testing this locally.
With the new web/desktop picker hopefully that works nicely on small screen widths. I think this is safe to close.