valor-software / ngx-bootstrap

Fast and reliable Bootstrap widgets in Angular (supports Ivy engine)
https://valor-software.com/ngx-bootstrap
MIT License
5.53k stars 1.69k forks source link

Date picker panel moving out of its parent input while scrolling #5905

Open sireeshap opened 4 years ago

sireeshap commented 4 years ago

this is duplicate of #2993 which is closed, but still persist in version "ngx-bootstrap": "^5.6.1". Please fix this to save developers life.

ProdigSun commented 4 years ago

I'm having the same problem. Is there any fix on the horizon?

casper5822 commented 2 years ago

Same problem for me with angular 12 and ngx-bootstrap ^7.1.2 with bootstrap 5

Nicolasp-dev commented 8 months ago

I have a similar issue, in my case I implemented the datepicker within a dropdown. When scrolling, the datepicker container moves and when hovering over it, it repositions itself, with a delay of 1 second. I checked and apparently under these conditions, the datepicker does not perceive the window scroll event, causing it to move along with the scroll and reposition later. I tried listening to the scroll event to see what was happening and it turns out that by doing so, the datepicker already associates the event with its logic, causing it to remain under its container.

I'm not sure if it's the best solution but it worked for me. scroll = (e: any) => console.log('scroll'); ngOnInit() { document.addEventListener('scroll', this.scroll, true); } ngOnDestroy() { document.removeEventListener('scroll', this.scroll, true); }