Thomas Keller

Joined

110 Experience
1 Lesson Completed
0 Questions Solved

Activity

Posted in Global Autocomplete Search Discussion

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?