Gu Gue
Gu Gue

Reputation: 189

How can I set reactdate-picker dropdown view to upper

Normal style of drop down view is at bottom after click,HOw can I set to upper place.plz Let me fix that. Here is my nomal datepicker in reactjs.

 <DatePicker
     selected={this.state.startDate}
    onChange={this.handleDateChange}
 />

Upvotes: 2

Views: 4020

Answers (1)

Andrija Ćeranić
Andrija Ćeranić

Reputation: 1723

Add prop for popperPlacement, like this:

<DatePicker
  ...
  popperPlacement="top-start"
>

React DatePicker does that automatically if there is not enough room for it on the bottom of the page, but this way you can "force" it.

See The source for additional placement options.

Upvotes: 6

Related Questions