Angular UI-Select:如何为文本溢出添加工具提示?

5
我有一个ui-select-match元素,当打开元素并悬停(高亮)在一行上时,如果文本溢出被边框切断,我需要一个工具提示来显示该行的完整内容。
这似乎应该是ui-select的一个功能,但我找不到任何关于这样的功能的参考。到目前为止,我只发现了显示行内全部文本的解决方案。
谢谢!
1个回答

7

在包含 ui-select-match 指令的元素上添加 title="{{selected.name}}",无论文本是否溢出,都会显示工具提示。

代码:

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

请看 这里

谢谢您的回答。我考虑过这个选项,但我需要工具提示仅在文本溢出时显示。 - Shaycobs

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接