You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.
Say we have the structure <div class="ancestor"><div class="descendant"></div></div>.
When using [exclude]="'.ancestor'", only elements with the class "ancestor" are excluded from the clickOutside event handler. Child elements are not excluded, so clicking on the ".descendant" element would cause clickOutside to emit.
I would like to exclude the elements matching the selector, as well as all descendant elements. For this I would propose to use a new input property excludeDescendants of boolean type. When true, the elements specified in exclude as well as all their descendants are excluded from the clickOutside event.
Not sure if excludeDescendants should also default to true, because I think most use cases for clickOutside would want to consider descendants when excluding elements anyway. In that case, I would consider to just change the behavior of exclude.
The text was updated successfully, but these errors were encountered:
You mean why not use [exclude]="'.ancestor,.descendant'"? The example was oversimplifying. In my actual use case, I want to exclude a dropdown that is injected by a library. The dropdown has quite a few dynamically added children, which is why it would be easier and less verbose to use [exclude]="'.dropdown'" and have it exclude all descendants as well.
Say we have the structure
<div class="ancestor"><div class="descendant"></div></div>
.When using
[exclude]="'.ancestor'"
, only elements with the class "ancestor" are excluded from theclickOutside
event handler. Child elements are not excluded, so clicking on the ".descendant" element would causeclickOutside
to emit.I would like to exclude the elements matching the selector, as well as all descendant elements. For this I would propose to use a new input property
excludeDescendants
of boolean type. When true, the elements specified inexclude
as well as all their descendants are excluded from theclickOutside
event.Not sure if
excludeDescendants
should also default to true, because I think most use cases forclickOutside
would want to consider descendants when excluding elements anyway. In that case, I would consider to just change the behavior ofexclude
.The text was updated successfully, but these errors were encountered: