Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Conversation

crisbeto
Copy link
Member

  • Adds the ability to select which element's scrolling will be disabled when a sidenav is open. This can be useful in the cases where the scrollable container isn't the direct parent of the sidenav.
  • Adds unit tests for the parent scroll prevention.

Fixes #8634

@crisbeto crisbeto added needs: review This PR is waiting on review from the team needs: work and removed needs: review This PR is waiting on review from the team labels Aug 18, 2016
if (disableScrollTarget) {
disableScrollTarget = angular.element(disableScrollTarget);
} else {
$log.warn($mdUtil.supplant('mdSidenav: couldn\'t find element matching ' +
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we should convert all $log.warn() to $log.debug() since .debug() can be disabled globally with $logProvider.debugEnabled(false)

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'm not sure we'd want that, because it could lead to cases where this might break in production, but the user wouldn't be able to see what went wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a breaking feature then... because the framework will complain using the default configuration (without a disabel scroll target).

Copy link
Member Author

Choose a reason for hiding this comment

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

It won't complain. If it's not specified, it will default to the direct parent like it does at the moment.

Copy link
Contributor

Choose a reason for hiding this comment

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

You are correct. I was confused with the code above... but the full code view shows that my concern is invalid. Thx.

* Adds the ability to select which element's scrolling will be disabled when a sidenav is open. This can be useful in the cases where the scrollable container isn't the direct parent of the sidenav.
* Adds unit tests for the parent scroll prevention.

Fixes angular#8634
@crisbeto crisbeto force-pushed the 8634/sidenav-prevent-scroll branch from 1779dce to 7d5912a Compare August 18, 2016 15:15
@crisbeto crisbeto added needs: review This PR is waiting on review from the team and removed needs: work labels Aug 18, 2016
@ThomasBurleson ThomasBurleson added pr: merge ready This PR is ready for a caretaker to review and removed needs: review This PR is waiting on review from the team labels Aug 22, 2016
@ThomasBurleson ThomasBurleson modified the milestone: 1.1.1 Aug 22, 2016
@jelbourn jelbourn merged commit 218c3ec into angular:master Aug 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr: merge ready This PR is ready for a caretaker to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants