sfletche
sfletche

Reputation: 49714

react-day-picker without overlay (input field only)

Wanting to leverage some of the built in functionality (date validation, etc) of react-day-picker while not offering the calendar overlay (offering the user an input field without the calendar overlay).

I'm not seeing any options in the docs to show only the input field without the calendar overlay.

Am I missing something?

Upvotes: 1

Views: 1143

Answers (2)

Sulthan
Sulthan

Reputation: 130092

Nope, looking into the source but it's open source. You can copy the file and remove the parts you don't need.

Upvotes: 0

ztadic91
ztadic91

Reputation: 2804

Maybe a hacky way but I can see that you can provide custom prop classNames to the DayPickerInput component. Source

And you could provide an object like

<DayPickerInput>
    classNames={{
       overlayWrapper: 'myCustomClass'
    }}
/>

.myCustomClass {
    display: none;
}

or if you can hide the default class for the overlay wrapper

.DayPickerInput-OverlayWrapper {
    display: none!important;
}

Upvotes: 2

Related Questions