p-calendar datepicker is closing when scrolling on container
If you have a PrimeNG PRO Support subscription please post your issue at;
https://pro.primefaces.org
where our team will respond within 4 business hours.
If you do not have a PrimeNG PRO Support subscription, fill-in the report below. Please note that your issue will be added to the waiting list of community issues and will be reviewed on a first-come first-serve basis, as a result, the support team is unable to guarantee a specific schedule on when it will be reviewed. Thank you for your understanding.
Current Queue Time for Review Without PRO Support: ~8-12 weeks. With PRO Support: 1 hour
I'm submitting a ... (check one with "x")
[X] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Plunkr Case (Bug Reports) Please demonstrate your case at stackblitz by using the issue template below. Issues without a test case have much less possibility to be reviewd in detail and assisted.
https://stackblitz.com/edit/github-i6mewe?file=src/app/app.component.html
Current behavior
Using p-calendar in a modal with scroll causes the datepicker to close when scrolling. in version 11.1.0 this does not happen.
Expected behavior
scrolling on the modal should not close the datepicker
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
angular 11 with primeng 11.2.2
- Angular version: 5.X
angular 11
- PrimeNG version: 5.X
11.2.2
- Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
chrome
-
Language: [all | TypeScript X.X | ES6/7 | ES5]
-
Node (for AoT issues):
node --version=
I also facing this issue. I notice that it only happens if we use flex layout and wrapper div has CSS property-> flex: 1; overflow: auto;
Thanks Rajneesh Joshi
@rajneeshjoshi4 We can solve this by adding overflow : overlay; To the container and it works for me
Thanks @hrp03
overflow : overlay; is a non-standard value only supported by the WebKit-browsers but is now depreciated and it is the same as auto does. You must see it: Browser support
Am also facing the same issue ....whats the solution now ..... can anyone help
I'm seeing a similar issue, in my case it's not closing immediately after scrolling every time. Sometimes it stays open, but will close when I attempt to interact with any portion of the popup that was previously out of view before being scrolled into view.
I'm seeing that the overlayAnimation is being triggered or is the trigger when the close event is fired.
Same issue here, following...
I am also facing the exact same issue. Would be great is someone could fix it.
Using appendTo property on p-calendar inside the p-dialog fixed this issue for me
appendTo="body"
@rajneeshjoshi4 We can solve this by adding overflow : overlay; To the container and it works for me
Thank you so much! it works for me too! : D
@ViewChild() inputDate: Calendar; ngAfterViewInit() { this.calendar.scrollHandler = { bindScrollListener : ()=>{} , unbindScrollListener : ()=>{} }; } The solution in angular.
@damir-ovcina: your solution works partially, it throws the following error
ERROR Error: Uncaught (in promise): TypeError: this.scrollHandler.destroy is not a function TypeError: this.scrollHandler.destroy is not a function at Calendar.ngOnDestroy (primeng-calendar.mjs:2279:32) at executeOnDestroys (core.mjs:7601:32) at cleanUpView (core.mjs:7502:9) at destroyViewTree (core.mjs:7335:17) at destroyLView (core.mjs:7480:9) at RootViewRef.destroy (core.mjs:21935:9) at ComponentRef.destroy (core.mjs:22354:23)
@ViewChild() inputDate: Calendar; ngAfterViewInit() { this.calendar.scrollHandler = { bindScrollListener : ()=>{}, unbindScrollListener : ()=>{}, destroy : ()=>{} }; }
@ryann3588: yes I did the same change and it's working. but now the issue is when we scroll using the scrollbar the calendar disappears, but in case if scroll using touchpad it works.
@spatil1240 I believe it also hides on window resize. If you're testing on a mobile device, that might be causing the problem.
Hi,
So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap? Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!
Best Regards,
Hi there! The problem is no improvement yet! v.9.6.0
@mertsincan As per above - this has not been solved and is still a problem
Hi, I had the same issue in my angular 18 application. please help me, without appendTo property can we solve this issue. I am using primeng 19.0.5 version
I was experiencing the same issue on PrimeReact v9.5.0. After upgrading to v10.9.6, the issue appears to be resolved.