Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bottom-sheet): allow disableClose to be updated after opened #14711

Merged

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Jan 3, 2019

Allows for the disableClose value of a bottom sheet to be updated after it has been opened, similarly to MatDialog.

Fixes #14708.

Allows for the `disableClose` value of a bottom sheet to be updated after it has been opened, similarly to `MatDialog`.

Fixes angular#14708.
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Jan 3, 2019
@crisbeto crisbeto requested a review from jelbourn as a code owner January 3, 2019 11:13
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jan 3, 2019
@@ -42,6 +45,7 @@ export class MatBottomSheetRef<T = any, R = any> {
// @breaking-change 8.0.0 `_location` parameter to be removed.
_location?: Location) {
this.containerInstance = containerInstance;
this.disableClose = containerInstance.bottomSheetConfig.disableClose;
Copy link
Member

Choose a reason for hiding this comment

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

Will this potentially change the behavior since you are setting the value in the class instead of reading it from the object at the time of the check?

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 change the behavior, because the old approach only read it once on init.

Copy link
Member

Choose a reason for hiding this comment

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

Ahh, yes because it set up the subscription based on that. Makes sense.

Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -42,6 +45,7 @@ export class MatBottomSheetRef<T = any, R = any> {
// @breaking-change 8.0.0 `_location` parameter to be removed.
_location?: Location) {
this.containerInstance = containerInstance;
this.disableClose = containerInstance.bottomSheetConfig.disableClose;
Copy link
Member

Choose a reason for hiding this comment

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

Ahh, yes because it set up the subscription based on that. Makes sense.

@josephperrott josephperrott added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Jan 9, 2019
@vivian-hu-zz vivian-hu-zz merged commit 3d3179f into angular:master Jan 16, 2019
s2-abdo pushed a commit to s2-abdo/material2 that referenced this pull request Jan 18, 2019
…ular#14711)

Allows for the `disableClose` value of a bottom sheet to be updated after it has been opened, similarly to `MatDialog`.

Fixes angular#14708.
s2-abdo pushed a commit to s2-abdo/material2 that referenced this pull request Jan 18, 2019
…ular#14711)

Allows for the `disableClose` value of a bottom sheet to be updated after it has been opened, similarly to `MatDialog`.

Fixes angular#14708.
vivian-hu-zz pushed a commit that referenced this pull request Jan 18, 2019
)

Allows for the `disableClose` value of a bottom sheet to be updated after it has been opened, similarly to `MatDialog`.

Fixes #14708.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the availability to disable the close of a bottomSheet programatically once is opened.
5 participants