Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAST autocomplete is broken #1916

Closed
jrochkind opened this issue Oct 26, 2022 · 5 comments
Closed

FAST autocomplete is broken #1916

jrochkind opened this issue Oct 26, 2022 · 5 comments
Assignees

Comments

@jrochkind
Copy link
Contributor

Maybe broke as part of our vite migration?

When I type in the should-be-autocompleted subject field on production, I get this JS error in dev console:

5qa_autocomplete.js:56 Uncaught TypeError: o.autocomplete is not a function
    at Vi (qa_autocomplete.js:56:14)
    at HTMLInputElement.<anonymous> (qa_autocomplete.js:124:7)
    at HTMLBodyElement.dispatch (jquery.js:5430:27)
    at N.handle (jquery.js:5234:28)
    at Object.trigger (jquery.js:8745:12)
    at Object.simulate (jquery.js:8814:16)
    at HTMLDocument.n (jquery.js:8848:17)
@jrochkind jrochkind self-assigned this Oct 26, 2022
@jrochkind
Copy link
Contributor Author

Hm, the file that implements autocomplete does a:

import 'devbridge-autocomplete';

Under webpacker, that was enough to make a jquery .autocomplete() function available. Under vite it appears not to be, not sure why or how to fix, looking into it.

@jrochkind
Copy link
Contributor Author

jrochkind commented Oct 26, 2022

filed devbridge/jQuery-Autocomplete#843

@jrochkind
Copy link
Contributor Author

jrochkind commented Oct 26, 2022

Hm. We could copy and paste that jquery plugin to a local file, and edit it's loading code to work.

We could switch to a whole different autocomplete implementation (that one isn't very actively maintained, and requires jquery; although it works well). Blacklight just switched to: https://github.com/github/auto-complete-element

It would require some changes to switch to that one -- uses web components, so markup changes. Server is expected to return actual HTML, not json. But it would probably work in the end?

@jrochkind
Copy link
Contributor Author

jrochkind commented Oct 26, 2022

Huh, while it also hasn't been maintained in forever, there may be a non-jQuery autocomplete alternative from the same source that may import properly and require few code changes....

https://github.com/devbridge/Vanilla-Autocomplete

Very limited docs though. Also seems to maybe not be released to npm, annoying.

jrochkind added a commit that referenced this issue Oct 26, 2022
… released one

We couldn't figure out how to get our vite setup to load it properly otherwise. See #1916 and devbridge/jQuery-Autocomplete#843

We don't love this whole autocomplete implementation, but keep it working for now. Haven't found any alternatives we love. Extensive comments left in source on analysis of tech issues and options.
@jrochkind
Copy link
Contributor Author

Another one we could maybe switch to in future: https://github.com/digitalfortress-tech/typeahead-standalone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant