React-datepicker: Styling is broken

Created on 12 Apr 2019  路  6Comments  路  Source: Hacker0x01/react-datepicker

Expected behavior

Date picker to appear as preview

Actual behavior

No formatting dates appear in a straight line up page

Steps to reproduce

I created a new project via npx create-react-app and only instead react-datepicker and was able to reproduce this issue.

Also happens in an existing project.

Both version 2.3.0

Screenshots:

The first screenshot is when added to an existing project with Bulma imported. The second has nothing but react-datepicker.
In second screenshot that little 4 you see on the right side is what appears when the date picker is selected.

Both tested on current Firefox and current Chromium.

2019-04-11_155503383419

2019-04-11_155503378319

Most helpful comment

In the README under 'Installation' it says:

import 'react-datepicker/dist/react-datepicker-cssmodules.css';

when it should be:

import "react-datepicker/dist/react-datepicker.css";

Thanks for pointing this out @kalenpw !

All 6 comments

were you able to fix it?

Yes, I didn't realize the css was kept separate, but now I understand why.

I am also getting the same view but I am unable to resolve. I am using datepicker with babel-plugin-react-css-modules. imported CSS from node modules dist folder still styling is not getting applied.
Created ticket #1809 .
Please let me know you also having the same config.

In the README under 'Installation' it says:

import 'react-datepicker/dist/react-datepicker-cssmodules.css';

when it should be:

import "react-datepicker/dist/react-datepicker.css";

Thanks for pointing this out @kalenpw !

Hi! Is this .css above also applies to "Select Time Only" react-datepicker. I can't get the same view as one in here.. https://reactdatepicker.com/

Hi! Is this .css above also applies to "Select Time Only" react-datepicker. I can't get the same view as one in here.. https://reactdatepicker.com/

hi @imnobunny I think it's because you use both of todayButton and showTimeSelect, I fix that issue by hiding todayButton LOL. I think react-datepicker doesn't support yet if we use todayButton and showTimeSelect at the same place

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hoodsy picture hoodsy  路  3Comments

ali-master picture ali-master  路  3Comments

jcabrerazuniga picture jcabrerazuniga  路  3Comments

carmouche picture carmouche  路  3Comments

formigone picture formigone  路  3Comments