Skip to content

Does not work together with Tether/React Tether #17

@ghost

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
bildschirmfoto 2016-07-14 um 10 46 22

, but the calendar is positioned absolutely to the viewport with javascript and is in the DOM before the closing body tag
bildschirmfoto 2016-07-14 um 10 44 16

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.

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