igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

`excludePositionTarget` property as a public API

Open tkiryu opened this issue 7 years ago • 2 comments

Is your feature request related to a problem? Please describe.

#4470. I have the same issue with my drop down component using igx-drop-down.

Here is a sample. https://stackblitz.com/edit/igx-drop-down-opening-issue

Steps to reproduce

  1. Run the sample above.
  2. Click arrow down button.
  3. Click arrow up button.

Resut

After step 3, drop-down opened again.

Expected result

After step 3, drop-down should close.

Describe the solution you'd like

I'd like to use excludePositionTarget property to solve the problem.

Thanks to the fix for #4470, I found out that I can solve the problem by setting excludePositionTarget: true .

But, currently, excludePositionTarget property is not exposed as a public API. https://github.com/IgniteUI/igniteui-angular/blob/7.2.6/projects/igniteui-angular/src/lib/services/overlay/utilities.ts#L55-L59

Could you expose excludePositionTarget? Or, any concerns about doing that?

tkiryu avatar Apr 22 '19 02:04 tkiryu

excludePositionTarget property was added for internal use only. We are using it in igxToggleAction. This allows user to close the toggle by clicking on igxToggleAction's target, when closeOnOutsideClick is set to true. If anyone need to exclude the target he can use igxToggleAction - this will automatically set excludePositionTarget to true. This is why we prefer to retain this property as private. Please note, igxOverlay has no option allowing you to exclude other elements from closeOnOutsideClick. For example imagine that you have a button somewhere in the page and an input on totally different place in the same page. On button click you are opening a toggle (or drop down) and the target of the toggle is the input. Right now there is no way to exclude the button from close on outside click as it is not the target. If this is what you need please log a new issue - feature request and we will look into it.

wnvko avatar May 07 '19 14:05 wnvko

@wnvko , thank you for explaining why excludePositionTarget is private and we can use igxToggleAction instead. I totally understand!

I'm closing it.

tkiryu avatar May 08 '19 05:05 tkiryu