試圖瞭解如何僅在角度typeahead下拉菜單中實現pull-right
類。typeahead下拉結果右對齊 - 右對齊
問題:
- 輸入位於窗口的RHS(這是典型的搜索輸入框)
- 我的結果是較寬然後我的輸入(和內含div)
- 我需要下拉的右側與輸入框的右側對齊,並在輸入寬度的左側(下方)延伸。
- (下拉只需要轉移,文本對齊內不會改變,應保持對齊到左即不是一個RTL在這個問題:。RTL for angularjs bootstrap's typeahead)
應用pull-right
類的容器div沒有按」 t似乎不依賴於輸入而影響下拉。
我不知道還有什麼地方放?
是否有控制下拉div對齊的CSS方法?
已修改在以下Plunker的documentation example:(?也許不必要)
- 包括內含div
- 置於含有div來縮小寬度
pull-right
類
如果您在plunker示例輸入框中鍵入「ang」,您會看到結果溢出窗口右側。
<div class='column'>
<div class='container-fluid pull-right' ng-controller="TypeaheadCtrl">
<h4>Asynchronous results</h4>
<pre>Model: {{asyncSelected | json}}</pre>
<input type="text" ng-model="asyncSelected" placeholder="Locations loaded via $http" typeahead="address for address in getLocation($viewValue)" typeahead-loading="loadingLocations" class="form-control">
<i ng-show="loadingLocations" class="glyphicon glyphicon-refresh"></i>
</div>
</div>
我看着下面的問題,這似乎並沒有幫助我:
- SO issue 22075432 - 預輸入型取向的問題
- github bootstrap問題2045
感謝@ M.Doye - 看起來像一個很好的解決方案 - 將這項工作在純angularjs環境? (我們目前沒有在應用程序中使用jquery)。我認爲這需要某種指示? – Ben 2015-04-02 17:31:01
@你可以用CSS來做,但必須使用'!important'。已經更新了我的答案以及猛擊 – Und3rTow 2015-04-02 17:43:37
看起來不錯!用兩個不同的輸入框和不同的結果對齊來修改你的plunker顯示你的CSS解決方案http://plnkr.co/edit/3arh1IOcKFQoNsqG5hwM?p=preview – Ben 2015-04-02 17:59:12