Ask A Question

Notifications

You’re not receiving notifications from this thread.

Global Autocomplete Search Discussion

did you manage to solve this?

Reply

I am trying to implement this on a rails 7 project (using jsbundling-rails for my javascript).
When I manually setup the data in the console and invoke autoComplete on the form - it works.
However when I am using the function, I get this error as soon as i start typing a letter into the form:
jquery.easy-autocomplete.js:661 Uncaught TypeError: Cannot read properties of undefined (reading 'length')
at reduceElementsInList (jquery.easy-autocomplete.js:661:62)
at proccessData (jquery.easy-autocomplete.js:614:10)
at ListBuilderService.processData (jquery.easy-autocomplete.js:455:27)
at Object. (jquery.easy-autocomplete.js:1377:45)
at fire (jquery.js:3500:31)
at Object.fireWith as resolveWith
at done (jquery.js:9796:14)
at XMLHttpRequest. (jquery.js:10057:9)

I have modified the function slightly - the first line now reads:
document.addEventListener("turbo:load", function () { ...

and then later on, where the original function invoked "turbolinks.load(url)", I have replaced that with turbo.load(url).

Any ideas?

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 84,256+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.