Flatpickr: Flatpickr theme does not apply on small screen device

Created on 5 Apr 2018  路  3Comments  路  Source: flatpickr/flatpickr

Hello,

I am currently building a mobile-first designed, responsive web app using Ruby on Rails.

I adapted flatpickr to fit to small screen devices, with the dark theme.

The issue is every time I go to localhost, with a iPhone6/7/8 device width screen, as a typical user would do, all my CSS and dark theme does not apply, it just shows the default flatpickr design calendar.

capture d ecran 2018-04-05 a 11 42 51

However, if I hard refresh on a desktop width screen, it applies.

capture d ecran 2018-04-05 a 11 43 42

Then if I resize (without refreshing) to iPhone6/7/8, it still applies.
capture d ecran 2018-04-05 a 11 44 06

But then again, if I refresh on this same iPhone6/7/8 screen, it does not apply anymore.
capture d ecran 2018-04-05 a 11 45 03

Did someone already have this issue? Is there any way to fix it?

Thank you!

Your Environment

  • flatpickr version used: 4.4.3
  • Browser name and version: Chrome version 65.0.3325.181
  • OS and version: macOS High Sierra Desktop

Most helpful comment

I think @aldhsu meant disableMobile: true to always show the Flatpickr calendar.

All 3 comments

Old issue but I didn't see a resolution. For anyone coming here in the future:

The issue is every time I go to localhost, with a iPhone6/7/8 device width screen, as a typical user would do, all my CSS and dark theme does not apply, it just shows the default flatpickr design calendar.

I don't think that is the default flatpickr design. That looks like desktop Chrome's native datetime picker. Flatpickr changes to a <input type="date"> on mobile and doesn't have an altInput. Notice your input box lacks the placeholder or red background. You can disable this behaviour if you want to always show flatpickr calendar by adding the option disableMobile: false https://flatpickr.js.org/options/.

@aldhsu that is spot on.

Closing the issue as resolved. Please reopen if necessary

I think @aldhsu meant disableMobile: true to always show the Flatpickr calendar.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

T-Hugs picture T-Hugs  路  3Comments

mchaves-ciandt picture mchaves-ciandt  路  3Comments

719media picture 719media  路  3Comments

CorentinMic picture CorentinMic  路  3Comments

pimskie picture pimskie  路  3Comments