Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time input field cuts AM/PM text due to short width #2697

Closed
alejo4373 opened this issue Jan 24, 2021 · 2 comments
Closed

Time input field cuts AM/PM text due to short width #2697

alejo4373 opened this issue Jan 24, 2021 · 2 comments
Labels

Comments

@alejo4373
Copy link

The default width for the time input field when showTimeInput=true is currently set to 85px in the src seen here which cuts the AM/PM text as seen in the screenshots below.

Screenshots

Firefox: 81.0.2 (64-bit)

Screen Shot 2021-01-23 at 8 23 08 PM

Chrome: Version 88.0.4324.96 (Official Build) (x86_64)

Screen Shot 2021-01-23 at 8 22 45 PM

To Reproduce

  1. Go to https://reactdatepicker.com/#example-input-time
  2. Click on the Date Picker
  3. Inspect the time input and compare to the screenshots above

Expected behavior
Input field displays all its content without cutting out any of its text.

I would suggest removing the 85px and let the browser decide the width necessary. This is what I'm doing in my override of the CSS using inline styles with

<style>{`
  .react-datepicker__input-time-container 
  .react-datepicker-time__input-container 
  .react-datepicker-time__input input {                    
     width: unset
  }
`}</style>

I am wondering if anyone else is experiencing this issue.

Desktop

  • OS: macOS Catalina, Version 10.15.7
  • Browsers
    • Chrome Version 88.0.4324.96 (Official Build) (x86_64)
    • Firefox 81.0.2 (64-bit)

Additional context

  • This seems to affect Firefox and Chrome. Safari V.14.0.1 shows a 24 hour clock so the AM/PM text is never there.
  • On mobile(iPhone SE) Chrome and Safari display the native time picker and 85px is more than enough to show all text content + it seems the iPhone has a smaller font-size for inputs.
  • This feature/variant was introduced in PR #1591 by @gautam-pahuja
@chopify
Copy link

chopify commented Jan 29, 2021

Thank you for the temporary fix. I'm am seeing the same issue after PR #1591

@stale
Copy link

stale bot commented Jul 29, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 29, 2021
@stale stale bot closed this as completed Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants