Ok, I've done some more debug. The autocomplete text box works still. But it doesn't seem to work with 0 chars.
I can see when the user clicks in the text box a request is generated, and a response is generated. I can use the chrome debugger to see that the response is as expected. The AJAX request seems to just not render the HTML when the number of chars is 0, even though it does all the work to generate a request and parse the response. As soon as I type a character I get the expected auto-complete results displayed. When I backspace back to 0 chars it doesn't display anything, but it still does the AJAX request. There must be a place in prototype.js where there is a decision to render the html or not? I can't seem to find it. So I'm just looking for some hints on why that wouldn't happen sometimes.. On Mar 14, 11:27 am, pipplo <[email protected]> wrote: > I have a weird bug that I'm having trouble debugging. I am using Rails > but I think the issue is in the javascript handling somewhere. > > I have a div with a form and autocomplete > > <div id=form> > <form info> > <autocomplete box> > </form> > </div> > > I have the options set so that when the user clicks in the auto- > complete they get an initial list (minChars = 0) > > When the user types a user name in the autocomplete and selects one of > the drop down options I generate a request via Ajax and render the > form again without the autocomplete. The user can then click 'remove' > to remove the user info and re-draw the autocomplete box. > > After the re-draw the minChars = 0 doesn't work. Whenever I click in > the box I see a request generated to my controller, and I return the > correct information but it doesn't get rendered into HTML and I dont > see a drop down. > > If the user types a letter or name then the dropdown lits does show > up, but the initial ajax request never gets reflected. > > I assume there is some state variable that thinks the text box hasn't > changed value or something which is preventing actually rendering the > HTML returned by Rails. > > I hope that makes sense. Any ideas? > > P.S. My current workaround is to just hide the autocomplete field and > not render it empty. This works but won't be usable in other parts of > my site. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
