I'm using the same component on top of a modal and on a regular page.
<ng-select
[items]="obs$ | async"
[appendTo]="body"
>
</ng-select>
This works for the regular page, but for a modal, the select values go behind the modal. What will be the value of appendTo if I don't provide it with any value.
<ng-select
[items]="obs$ | async"
>
</ng-select>
this works for modal but not for the regular page. The select menu gets clipped
<ng-select
[items]="obs$ | async"
[appendTo]="null" -> this doesn't work (i.e) the select options are behind the modal
>
</ng-select>
From looking at the source code of ng-select, the default is to place the dropdown directly inside the element. For a modal, this can cause problem by clipping or showing scroll bar.
You should append it to the body and change the
z-index
of.ng-dropdown-panel
in css to be greater than the modal.