Skip to content

Flatpickr doesn't scroll properly #223

@info-chientran

Description

@info-chientran

I'm working on a project where I added flatpickr to a modal. Whenever I scroll the modal scrolls as well but flatpickr remains on the same area relative to the background. See the screenshots for an example of what I mean

image

image

My code:

<div>
     <Flatpickr
         ref={endDateRef}
         className="flatpickr-input min-w-96 cursor-pointer border border-neutral-4 px-3 py-2 focus:border-neutral-1 focus:outline-none"
         placeholder="dd/mm/yyyy"
         onChange={(date) =>
             setEndDate(() => (date[0] ? formatDate('yyyy-mm-ddThh:mm:ss', date[0]) : ''))
         }
         options={{
             dateFormat: 'd/m/Y',
             minDate: startDate ? formatDate('dd/mm/yyyy', startDate) : 'today'
         }}
     />
 </div>

flatpickr version used: 3.10.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions