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): inject correct directionality in child components #9996

Merged

Conversation

crisbeto
Copy link
Member

Currently the MatBottomSheetConfig.direction property will add the dir attribute to the overlay, however that doesn't mean that child components that inject the Directionality will be able to pick it up (e.g. sliders, menus etc.). These changes add an extra injection token that'll expose the direction to child components.

@crisbeto crisbeto requested a review from jelbourn as a code owner February 17, 2018 11:24
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Feb 17, 2018
injectionTokens.set(Directionality, {
value: config.direction,
change: observableOf()
});
Copy link
Member

Choose a reason for hiding this comment

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

We should only set this token if there's not already a Directionality in the userInjector

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Currently the `MatBottomSheetConfig.direction` property will add the `dir` attribute to the overlay, however that doesn't mean that child components that inject the `Directionality` will be able to pick it up (e.g. sliders, menus etc.). These changes add an extra injection token that'll expose the direction to child components.
@crisbeto crisbeto force-pushed the bottom-sheet-provide-directionality branch from afaad52 to 70bd495 Compare February 17, 2018 16:37
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Feb 17, 2018
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Feb 17, 2018
@jelbourn jelbourn merged commit 9d784a0 into angular:master Feb 18, 2018
crisbeto added a commit to crisbeto/material2 that referenced this pull request Feb 18, 2018
…ready

Switches the dialog injector to provide the `Directionality` only when the user-provided injector doesn't have one already.

Relates to angular#9996.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Feb 18, 2018
…ready

Switches the dialog injector to provide the `Directionality` only when the user-provided injector doesn't have one already.

Relates to angular#9996.
tinayuangao pushed a commit that referenced this pull request Feb 20, 2018
…9996)

Currently the `MatBottomSheetConfig.direction` property will add the `dir` attribute to the overlay, however that doesn't mean that child components that inject the `Directionality` will be able to pick it up (e.g. sliders, menus etc.). These changes add an extra injection token that'll expose the direction to child components.
@andrewseguin andrewseguin added target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Feb 20, 2018
jelbourn pushed a commit that referenced this pull request Feb 26, 2018
…ready (#10004)

Switches the dialog injector to provide the `Directionality` only when the user-provided injector doesn't have one already.

Relates to #9996.
mmalerba pushed a commit to mmalerba/components that referenced this pull request Feb 26, 2018
…ready (angular#10004)

Switches the dialog injector to provide the `Directionality` only when the user-provided injector doesn't have one already.

Relates to angular#9996.
jelbourn pushed a commit to jelbourn/components that referenced this pull request Feb 27, 2018
…ready (angular#10004)

Switches the dialog injector to provide the `Directionality` only when the user-provided injector doesn't have one already.

Relates to angular#9996.
@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 8, 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: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants