-
Notifications
You must be signed in to change notification settings - Fork 73
Description
Not sure if this issue belongs here.
I am facing a problem that I put a datepicker https://github.com/Hacker0x01/react-datepicker as dropdown content. The datepicker is using Tether to connect the input field component to the calendar component.
The date input field is a child of dropdown content

, but the calendar is positioned absolutely to the viewport with javascript and is in the DOM before the closing body tag

Your code adds a click listener on window and inside this click listener you check if the clicked element was the dropdown node or one of its child nodes. What happens now is as soon as the user clicks on the calendar the dropdown closes, since the calendar is technically not inside the dropdown content.
I am not sure how to best tackle this problem, since it could be solved on your side, maybe by adding an extra check for tether elements or by using getBoundingClientRect to determine the position of the clicked element and check if its inside the dropdown content.