Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

feat(typeahead): Add title to matches #5252

Closed
wants to merge 1 commit into from

Conversation

deeg
Copy link
Contributor

@deeg deeg commented Jan 14, 2016

This adds a title attribute to the typeahead matches.

This helps if users want to truncate text and set a max width of the typeahead.

This allows the user to hover over a match and get the full text of the label.

Let me know if you want me to make this configurable in the options to allow the user to chose if they want the title attribute.

<a href
tabindex="-1"
ng-bind-html="match.label | uibTypeaheadHighlight:query"
ng-attr-title="{{match.label}}"></a>
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason for ng-attr here instead of just title="{{...}}"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These guys explain it pretty well.

It is basically so you never see the text {{match.label}} in the tooltip. This will only add the title attribute with the actual value of match.label.

@wesleycho wesleycho added this to the 1.0.4 milestone Jan 14, 2016
@wesleycho
Copy link
Contributor

LGTM, thanks for this!

@wesleycho wesleycho closed this in f523361 Jan 14, 2016
@deeg deeg deleted the add-typeahead-title-attr branch April 12, 2016 13:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants