crowdint / rails3-jquery-autocomplete

An easy and unobtrusive way to use jQuery's autocomplete with Rails 3

Home Page:http://rubygems.org/gems/rails3-jquery-autocomplete

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prevent elements mentioned by "update-elements" from clearing

kakra opened this issue · comments

How do I prevent elements mentioned by the "update-elements" hash from being cleared as soon as the user starts typing? I only want them being updated if an autocomplete item is explicitly selected. This should be configurable because I have other use cases where I prefer the default behavior.

This is my use case scenario:

We have a list of field pairs (description, url) for a nested set of links attached to a post. The user will enter some text into the description, auto suggestions pop-up to suggest links found by the full-text indexer and creating an internal link if selected (like "post:///12345" or "download:///34567"). If the url field is already populated, the purpose of changing the description may be solely for editing purposes while the url should not change. This does not seem to be supported.

I could work around this by using a custom select event but actually that looks like a general use case to me and should be integrated into rails3-jquery-autocomplete.