Angular UI-Select: How to add a tooltip for text overflow?
Asked Answered
S

1

5

I have a ui-select-match element, and when opening the element and hovering (highlighting) over a row I need a tooltip to show the full content of the row in case of text overflow that is cut off by the border.

It seems like something that should have been a feature of ui-select but I couldn't find any reference for such a thing. So far I only found solutions that show the entire text inside the row.

Thanks!

Selfdeprecating answered 20/9, 2015 at 12:35 Comment(0)
H
7

What about putting title="{{selected.name}}" on the element holding the ui-select-match directive. The tooltip will be in any case though, not only when text overflows.

Code:

<ui-select ng-model="address.selected"
             theme="bootstrap"
             ng-disabled="disabled"
             reset-search-input="false"
             style="width: 300px;">
    <ui-select-match title="{{address.selected.formatted_address}}" placeholder="Enter an address...">{{$select.selected.formatted_address}}</ui-select-match>
    <ui-select-choices repeat="address in addresses track by $index"
             refresh="refreshAddresses($select.search)"
             refresh-delay="0">
      <div ng-bind-html="address.formatted_address | highlight: $select.search"></div>
    </ui-select-choices>
</ui-select>

See plnkr

Hypaethral answered 20/9, 2015 at 12:44 Comment(1)
Thanks for your answer. I thought about it as an option but I need the tooltip to show only with text overflows.Selfdeprecating

© 2022 - 2024 — McMap. All rights reserved.