HubSpot/drop — pull request #19 by byronmwong (2014-03-14 19:50:22+00:00)
Title: Check if click resides in attached Tethers

I encountered weird behavior when I placed a [Select](/hubspot/select) inside of a [Drop](/hubspot/drop).

Whenever a selection was made within the Select, the enclosing Drop would also close, because the Select's dropdown wasn't a child of the Drop's element in the DOM tree. This PR resolves this by checking if the click event's target resides within Tethers attached to the Drop.

There was another issue where the click event's target was being removed from the DOM (by `Select.update`) before `Drop.closeHandler` was being invoked, so it couldn't determine where in the DOM tree the event's target resided. This PR addresses that by invoking `Drop.closeHandler` during the capture phase, but actually closing the Drop on the next tick.

depends on https://github.com/HubSpot/tether/pull/38