Skip to content

Tooltip rtl #1830

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

Merged
merged 6 commits into from
Dec 5, 2016
Merged

Tooltip rtl #1830

merged 6 commits into from
Dec 5, 2016

Conversation

andrewseguin
Copy link
Contributor

@andrewseguin andrewseguin commented Nov 11, 2016

Closes #1085

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 11, 2016
@jelbourn
Copy link
Member

@andrewseguin needs rebase

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.

This reminded me that a feature still missing from the tooltip is ensuring that the position changes to be on-screen if it would otherwise go off-screen.

(the connected position strategy handles this already, but updating the transform origin would still be on the tooltip).

## `[md-tooltip]`
### Properties

| Name | Type | Description |
| --- | --- | --- |
| `md-tooltip` | `string` | The message to be displayed. |
| `tooltip-position` | `"above"|"below"|"before"|"after"` | The position of the tooltip. |
| `tooltip-position` | `"start"|"end"|"top"|"bottom"|"left"|"right"` | The position of the tooltip. |
Copy link
Member

Choose a reason for hiding this comment

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

We discussed this in the past and had decided that tooltip would use before and after instead of start and end.

The reasoning was that anything that is positioned relative to some other element would use before and after, and anything where the alignment is global (just based on the page layout) will be start and end.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, my brain latched on to before and after and I completely missed that we do want to keep above and below and relatively positioned items as well.

(this is something we need to make sure is consistent before beta)

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 aside minor comments; you can add the merge: ready label after changes

return { originX: 'center', originY: this.position };
}

const isDirectionLtr = !this._dir || this._dir.value == 'ltr';
Copy link
Member

Choose a reason for hiding this comment

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

optional: might be more readable to just say isRtl

if (this.position == 'right' ||
this.position == 'after' && isDirectionLtr ||
this.position == 'before' && !isDirectionLtr) {
return { originX: 'end', originY: 'center' };
Copy link
Member

Choose a reason for hiding this comment

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

Superfluous whitespace

@jelbourn
Copy link
Member

jelbourn commented Dec 2, 2016

@andrewseguin can you rebase / address last comments and then add the merge ready label?

@andrewseguin andrewseguin added the action: merge The PR is ready for merge by the caretaker label Dec 5, 2016
@andrewseguin
Copy link
Contributor Author

Address comments. No longer a breaking change, just adding left and right values. Added merge ready label

@mmalerba mmalerba merged commit 54bf6ce into angular:master Dec 5, 2016
@andrewseguin andrewseguin deleted the tooltip-rtl branch December 20, 2016 22:57
@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 6, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tooltip appeaers in the opposite side of the screen (RTL)
4 participants