'How to avoid p-dropdown from closing on body scroll apart from appendTo="body"

I am using Angular version 12 and PrimeNG version 12 for my project. For the same I am using primeng dropdown which gets closed on scrolling the body. Using appendTo="body" doesn't close the dropdown on scroll but moves the dropdown panel with it. Many people have faced this issue but I haven't found any workaround for it still.

 <div class="customScroll">
                     <p-dropdown filter="true" [options]="options" 
                         [(ngModel)]="model" 
                         (onChange)="filterTable()" [style]="{'width': '100%', 'margin-top': 
                         '10px', 'font-family': 'Roboto Regular'}">
                </p-dropdown>
    </div>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source