Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

fix(datepicker): enable scrolling when scope destroyed. #7544

Conversation

devversion
Copy link
Member

Currently when we change the route, while the pane is open, the scroll mask won't be removed.
That's why we should re-enable scrolling on scope destruction.

In this case, we also have to check for the pane to be open, because otherwise we may accidentally remove another scroll mask.

@jelbourn Can you also review please?

Fixes #7542

Currently when we change the route, while the pane is open, the scroll mask won't be removed.
That's why we should re-enable scrolling on scope destruction.

In this case, we also have to check for the pane to be open, because otherwise we may accidentally remove another scroll mask.

Fixes angular#7542
@devversion devversion added the needs: review This PR is waiting on review from the team label Mar 12, 2016
@EladBezalel
Copy link
Member

LGTM

this.detachCalendarPane();
this.isCalendarOpen = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of this because now the person working on this needs to know that isCalendarOpen must be set after detaching; this is a weird coupling of behaviors that makes brittle code. It would be much better to simple call enableScrolling() in the $destroy handler in addition to detachPane, which will no-op if scrolling isn't disabled.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can understand your thoughts. I had the behavior, you desired, before, but I thought calling enableScrolling is to generic, because detachPane will be always called after hidePane, so it made sense to me, to move the enable scroll function completely into the detachPane function.

ThomasBurleson pushed a commit that referenced this pull request Mar 16, 2016
When we change the route while the calendar pane is open, the scroll mask won't be removed. We need to re-enable scrolling on scope destruction.
In this case, we also have to check for the pane to be open, because otherwise we may accidentally remove another scroll mask.

Fixes #7542. Closes #7544.
ThomasBurleson pushed a commit that referenced this pull request Apr 1, 2016
When we change the route while the calendar pane is open, the scroll mask won't be removed. We need to re-enable scrolling on scope destruction.
In this case, we also have to check for the pane to be open, because otherwise we may accidentally remove another scroll mask.

Fixes #7542. Closes #7544.
ThomasBurleson pushed a commit that referenced this pull request Apr 1, 2016
When we change the route while the calendar pane is open, the scroll mask won't be removed. We need to re-enable scrolling on scope destruction.
In this case, we also have to check for the pane to be open, because otherwise we may accidentally remove another scroll mask.

Fixes #7542. Closes #7544.
@devversion devversion deleted the fix/datepicker-scrollmask-destroy branch April 19, 2016 19:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: review This PR is waiting on review from the team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants