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