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

Widget is truncated on mobile devices #77

Open
markg735 opened this issue Mar 18, 2017 · 1 comment
Open

Widget is truncated on mobile devices #77

markg735 opened this issue Mar 18, 2017 · 1 comment

Comments

@markg735
Copy link

When using presetRanges the widget is truncated on mobile devices. Tested on:

  • Samsung S7 edge
  • iPhone 5
  • Nexus 5X

Without presetRanges the widget will fit on these devices but it seems like things should be wrapped/resized.

@zdrive
Copy link

zdrive commented Aug 6, 2021

This can be resolved with a little bit of CSS:

@media only screen and (max-width: 420px){
    .comiseo-daterangepicker-presets{
        display: block;
        height: auto;
    }
}

Just make sure this runs after jquery.comiseo.daterangepicker.css has been loaded. Another option is to paste it into the CSS file, somewhere near the end.

My implementation is something like this, in the HTML <head> section:

<link rel="stylesheet" href="css/jquery.comiseo.daterangepicker.css">
<style>@media only screen and (max-width: 420px){.comiseo-daterangepicker-presets{display: block;height: auto;}}</style>

This CSS will stack the presetRanges box on top of the calendar ("display: block;") and reduce the empty space at the end of the presetRanges box ("height: auto;")

Adjust the breakpoint as desired. 420px should cover most mobile devices, but change it if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants