Closed lo1tuma closed 9 years ago
An easier way to achieve the same result would just be to have a <Tappable>
backdrop (be it visible or not, through opacity) and playing with z-index
Thanks for the suggestion @lo1tuma
I agree with @clauderic, there is a lot of detail involved in how you might implement onTapOutside
, including assumptions I'm not currently happy making in this component.
Specifically, there may be other elements which could block (or otherwise handle) the tap event in your page that could conflict with the handler we set up.
It seems clearer and simpler for cases like the one you've got to just implement the tappable backdrop behind the submenu component you're implementing.
Hi,
I want to implement a touch-friendly dropdown button which opens a submenu on a tap event and should close the submenu if a tap event is triggered somewhere outside of the dropdown button.
Similar modules:
ngTapOutside
directive