-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(bottom-sheet): inject correct directionality in child components #9996
Conversation
src/lib/bottom-sheet/bottom-sheet.ts
Outdated
injectionTokens.set(Directionality, { | ||
value: config.direction, | ||
change: observableOf() | ||
}); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
afaad52
to
70bd495
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ready Switches the dialog injector to provide the `Directionality` only when the user-provided injector doesn't have one already. Relates to angular#9996.
…ready Switches the dialog injector to provide the `Directionality` only when the user-provided injector doesn't have one already. Relates to angular#9996.
…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.
…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.
…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.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently the
MatBottomSheetConfig.direction
property will add thedir
attribute to the overlay, however that doesn't mean that child components that inject theDirectionality
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.