# Auto complete down arrow not working

**URL:** <https://www.ruby-forum.com/t/auto-complete-down-arrow-not-working/140244>\
**Category:** Rails\
**Created:** [June 12, 2008, 8:44am UTC](https://www.ruby-forum.com/t/auto-complete-down-arrow-not-working/140244 "2008-06-12T08:44:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![srinathbtech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@srinathbtech](https://www.ruby-forum.com/u/srinathbtech)\
**Post date:** [June 12, 2008, 8:44am UTC](https://www.ruby-forum.com/t/auto-complete-down-arrow-not-working/140244/1 "2008-06-12T08:44:54Z")

</div>

Hi all,  
i was using auto complete feature in my rails app, when i used to type a  
character it responds very well and displays all the items match with  
that character.

and now the thing is when i try to select any item from the list using  
my keyboard down (or) up arrrow, its not working in IE 7 and forced to  
use mouse at this point, but works pretty good in FF and also works fine  
when selected with mouse

and my code is :

Code : ruby - fold - unfold

1. 

2. 

```
    <%= my_text_field_with_auto_complete :article, :title,

```

{:index =\> ha.id, :class =\> “text”, :value =\> ha.article\_title},  
{:skip\_style =\> true} %\>  
3.   
4.

  
5.  
6. #partial for list:  
7. 
  
8. \<% @articles.each do |article| %\>  
9. - \<%= article.title %\>
  
10. \<% end %\>  
11. 
  
12.  
13.  
14. #controller:  
15. def auto\_complete\_for\_article\_title  
16. article\_index = params[:article].keys[0] # get index as its  
always only one at a time  
17.  
auto\_complete\_responder\_for\_article\_title(params[:article][article\_index][:title])  
18. end  
19.  
20. def auto\_complete\_responder\_for\_article\_title(value)  
21. @articles = Article.find\_by\_sql(“select title from articles  
where title like ‘%#{value}%’”)  
22. render :partial =\>  
‘/resources/homepages/article\_auto\_complete\_list’, :layout =\> false  
23. end

any suggestions !!  
thanks in advance .

---

<div class="post-metadata">

**Author:** ![srinathbtech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@srinathbtech](https://www.ruby-forum.com/u/srinathbtech)\
**Post date:** [June 13, 2008, 6:59am UTC](https://www.ruby-forum.com/t/auto-complete-down-arrow-not-working/140244/2 "2008-06-13T06:59:52Z")

</div>

suspect that could be a css problem. The drop down may be visible but  
perhaps not accessible because of the state of the surrounding div.  
If the probelem were occuring in firefox, you could play around with  
the css in firebug, but in IE it is less easy. Try making the div  
containing the lookup position: relative; and see what happens. Or  
for test purposes, move the autocomplete to another page element and  
gradually work it back to where you want it.

Tonypm

---

<div class="post-metadata">

**Author:** ![srinathbtech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@srinathbtech](https://www.ruby-forum.com/u/srinathbtech)\
**Post date:** [June 13, 2008, 12:30pm UTC](https://www.ruby-forum.com/t/auto-complete-down-arrow-not-working/140244/3 "2008-06-13T12:30:33Z")

</div>

Hi Tonypm thanks for ur Reply,

i have autocomplete css like this :  
Where should i add style position: relative; in my CSS  
plz help me, i want this to work in IE

div.auto\_complete {  
width: 350px;  
background: #fff;  
z-index: 100;  
}  
div.auto\_complete ul {  
border:1px solid #888;  
margin:0;  
padding:0;  
width:100%;  
list-style-type:none;  
}  
div.auto\_complete ul li {  
margin:0;  
padding:3px;  
}  
div.auto\_complete ul li.selected {  
background-color: #ffb;  
}  
div.auto\_complete ul strong.highlight {  
color: #800;  
margin:0;  
padding:0;  
}

thanks in advance !!!
