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

[Bug]: Date picker does not show full month name and year #512

Open
3 tasks done
cmorgancli opened this issue Sep 30, 2024 · 6 comments
Open
3 tasks done

[Bug]: Date picker does not show full month name and year #512

cmorgancli opened this issue Sep 30, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@cmorgancli
Copy link

cmorgancli commented Sep 30, 2024

Before submitting...

Context

The date picker does not show the full month name and year.
Screenshot 2024-09-30 at 2 33 15 PM

Current Behavior

The space allocated for the month name and year are not sufficient

Expected behavior

I expect the complete month name and year to display

Possible Solutions or Causes

This might be as simple as modifying the .datepicker-controls css width properties for the month and year selects

Steps to reproduce

You can see this bug right on the Materialize website https://materializeweb.com/pickers.html . Just activate the example date picker.

Your Environment

  • Version used: 2.1.0
  • Browser Name and version: Chrome, Firefox, Safari
  • Operating System and version (desktop or mobile): MacOS, iOS,
  • Additional information you want to tell us:
@cmorgancli cmorgancli added the bug Something isn't working label Sep 30, 2024
@cmorgancli
Copy link
Author

Workaround css:

.datepicker-controls .select-year input {
width: 80px;
}
.datepicker-controls .select-month input {
width: 110px;
}

@Jerit3787
Copy link

Jerit3787 commented Oct 10, 2024

Hi, does this works well on multiple screen sizes? If this works well, we can make a pr for this.

https://github.com/materializecss/materialize/blob/dda2c95aee0cadbba52c1cb726214d6ef8131e8b/sass/components/_datepicker.scss#L41C1-L47C4

 .select-year input {
    width: 50px;
  }

  .select-month input {
    width: 80px;
  }

In the code, the width is fixed as well and would be a good start to edit it.

@cmorgancli
Copy link
Author

Even with my workaround it isn't perfect on the smallest phone sized screens. The data displays, but it isn't centered. I think the issue is that .datepicker-modal has max-width: 325px;. I don't need to support a screen smaller than a modern iPhone, so I'm ok with it.

@gselderslaghs
Copy link

This seems to be caused by the dropdown input selects to inherit styling from the input fields styling, basically caused by the padding of the global input fields styling. Proposal to override styling for those fields on the Datepicker object @see CodePen: Materialize - Date picker full month name and year
Solution is working on all screen sizes

@cmorgancli
Copy link
Author

I tested that solution and agree it's better than my original workaround. Works on every screen size and looks great!

@ginosanterre
Copy link

Do you know if this bug will be fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants