arqex / react-datetime

A lightweight but complete datetime picker react component.
2k stars 870 forks source link

is it possible to show the datepicker as a dropup instead of a dropdown? #802

Open ariftoteles opened 3 years ago

ariftoteles commented 3 years ago

I'm Submitting a ...

[ ] Bug report
[ ] Feature request
[ ] Support request

Steps to Reproduce

Expected Results

Actual Results

Minimal Reproduction of the Problem

Other Information (e.g. stacktraces, related issues, suggestions how to fix)

ariftoteles commented 3 years ago

my date form is on the last line of the screen, looks ugly if datepicker appears as drop-dwon, is it possible to show the date picker as a drop-up instead of a drop-down?

GodAlmighty990 commented 2 years ago

Solve this with css. In the react-datetime/css/react-datetime.css add the following css

.rdtOpen.drop-above .rdtPicker { bottom: 0; }

now in your component

<DateTime className="drop-above" />

be sure to restart your server manually as you will be changing the css in the actual imported file. so do your npm start or whatever your start command is for your frontend