# Auto complete shakes my page

**URL:** <https://www.ruby-forum.com/t/auto-complete-shakes-my-page/144493>\
**Category:** Rails\
**Created:** [July 30, 2008, 9:04am UTC](https://www.ruby-forum.com/t/auto-complete-shakes-my-page/144493 "2008-07-30T09:04:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![czaraaj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/4bbf92/32.png) [@czaraaj](https://www.ruby-forum.com/u/czaraaj)\
**Post date:** [July 30, 2008, 9:04am UTC](https://www.ruby-forum.com/t/auto-complete-shakes-my-page/144493/1 "2008-07-30T09:04:23Z")

</div>

Hi All,

I am having a problem with auto complete, something to do with the CSS i  
think.

\<%= text\_field\_with\_auto\_complete ‘company’,‘name’, {}, :skip\_style =\>  
true, :indicator =\> ‘status-indicator’,:after\_update\_element =\>  
“function(element,value){ $(‘experience\_details’).show();  
$(‘company\_id’).value = value.id}” %\>

When you get a list of companies, if I move my up and down arrow to  
shift through the options, the page itself moves up and down (literally  
shakes!)

Here is the partial to show the list:

\<% for company in @companies -%\>- \>
\<%=h "#{company.name}" %\>
\<%=h "#{company.org\_type}" %\>
\<% end -%\>

Here is the CSS (which is pretty standard):  
.auto\_complete {  
position:absolute;  
width:250px;  
background-color:white;  
border:1px solid #ccc;  
margin:0px;  
padding:0px;

}

.auto\_complete ul {  
list-style-type: none;  
margin:0px;  
padding:0px;  
}

.auto\_complete ul li.selected  
{  
background-color: #d7ebfe;

}

.auto\_complete ul li {  
list-style-type: none;  
display:block;  
margin:0;  
padding:3px;  
height:32px;  
}

Please help me solve this.  
I tried this on IE, Mozilla and Safari, the page moves up and down in  
all 3.

Thanks in advance!  
Raj

---

<div class="post-metadata">

**Author:** ![czaraaj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/4bbf92/32.png) [@czaraaj](https://www.ruby-forum.com/u/czaraaj)\
**Post date:** [August 8, 2008, 10:24am UTC](https://www.ruby-forum.com/t/auto-complete-shakes-my-page/144493/2 "2008-08-08T10:24:46Z")

</div>

Ditto… havent found a solution yet

---

<div class="post-metadata">

**Author:** ![czaraaj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/4bbf92/32.png) [@czaraaj](https://www.ruby-forum.com/u/czaraaj)\
**Post date:** [August 12, 2008, 11:59am UTC](https://www.ruby-forum.com/t/auto-complete-shakes-my-page/144493/3 "2008-08-12T11:59:25Z")

</div>

sjdale wrote:

> Ditto… havent found a solution yet

Take a look at this:  
[http://www.ruby-forum.com/topic/128876#new](http://www.ruby-forum.com/topic/128876#new)

This solved our problem. some bug

---

<div class="post-metadata">

**Author:** ![czaraaj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/4bbf92/32.png) [@czaraaj](https://www.ruby-forum.com/u/czaraaj)\
**Post date:** [September 3, 2008, 3:37pm UTC](https://www.ruby-forum.com/t/auto-complete-shakes-my-page/144493/4 "2008-09-03T15:37:29Z")

</div>

Hi Raj,  
I’m betting you’ve long since figured this out, but perhaps its the  
forgery protection stuff kicking in? I found that did weird stuff  
until I used Ryan’s RailsCasts mechanism instead of the auto\_complete  
plugin (before I re-vamped, I disabled forgery protection for a few  
methods).  
-Dale

On Aug 7, 4:43 pm, sjdale [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Ditto… havent found a solution yet
> 
> Raj Man wrote:
> 
> > Hi All,
> 
> > I am having a problem with auto complete, something to do with the CSS i  
> > think.
