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(overlay): default to global directionality #9994

Merged

Conversation

crisbeto
Copy link
Member

Currently overlays default to the ltr direction, which means that consumers, whose apps are in RTL, have to pass in the direction explicitly for every overlay. These changes switch to taking the default direction from the global Directionality which is based on the body and html elements.

Fixes #9817.

Currently overlays default to the `ltr` direction, which means that consumers, whose apps are in RTL, have to pass in the direction explicitly for every overlay. These changes switch to taking the default direction from the global `Directionality` which is based on the `body` and `html` elements.

Fixes angular#9817.
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Feb 17, 2018
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 47674f1 into angular:master Feb 18, 2018
@philip-firstorder
Copy link

@crisbeto Shouldn't this also re-position the Pasta 3 (Spaghetti) and Pasta 4 (Tortellini) in the overlay-demo.ts when toggling the RTL button in the header?

I just tested now with your commits and the elements don't automatically reposition themselves.

overlay direction

@crisbeto
Copy link
Member Author

@philip-sultanescu this only determines the default direction for overlays, it's still up to the overlays to reposition themselves when the direction changes.

@philip-firstorder
Copy link

philip-firstorder commented Feb 20, 2018

@crisbeto But shouldn't they automatically reposition themselves like all the other controls do when the bidi event is triggered?
It seems like an overhead to have to program it specifically for the overlays.

tinayuangao pushed a commit that referenced this pull request Feb 20, 2018
Currently overlays default to the `ltr` direction, which means that consumers, whose apps are in RTL, have to pass in the direction explicitly for every overlay. These changes switch to taking the default direction from the global `Directionality` which is based on the `body` and `html` elements.

Fixes #9817.
@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
@crisbeto
Copy link
Member Author

That's because the OverlayRef doesn't have a reference to the dir instance that is specific to the trigger. We could add a parameter for it, but it seems like overkill for some that doesn't happen often.

@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.

Date picker RTL support
5 participants