indrimuska / angular-moment-picker

Angular Moment Picker is an AngularJS directive for date and time picker using Moment.js.
http://indrimuska.github.io/angular-moment-picker/
MIT License
527 stars 229 forks source link

Popup is fixed to location when scrolling #238

Open oriamd opened 6 years ago

oriamd commented 6 years ago

When scrolling, the popup position stay fixed to its location. Any idea how to fix it.?

AurelioB commented 6 years ago

Same problem here. I'm using angular-material and the issue is that scroll sometimes happens inside overflowed elements, but angular-moment-picker doesn't know about this:

angular.element(_this.$window).on('resize scroll', $scope.view.position);

So I just used jQuery (I needed this fixed ASAP and I'm already using jQuery in my project) to trigger repositioning whenever an md-content element gets scrolled:

$('md-content').on('scroll', $scope.view.position);

This is specific to angular material. You'll need to identify which element is overflowing in your project and target it.