fix autocomplete

pull/289/head
Pete Matsyburka 1 year ago
parent 1ceac968b0
commit c56f8cb38f

@ -25,7 +25,7 @@ class SubmittersAutocompleteController < ApplicationController
term = "#{params[:q].downcase}%"
submitters.where(column.matches(term, false, true))
submitters.where(column.matches(term))
else
Submitters.search(submitters, params[:q])
end

@ -45,11 +45,7 @@ export default class extends HTMLElement {
this.currentFetch.then(async (resp) => {
const items = await resp.json()
if (q.length < 3) {
resolve(items.filter((e) => e[this.dataset.field].startsWith(q)))
} else {
resolve(items)
}
}).catch(() => {
resolve([])
}).finally(() => {

Loading…
Cancel
Save