Browse Source

CLDC-1389: Set default option on accessible autocomplete (#778)

* Set default option on accessile autocomplete

* Filter out select an option value when javascript
pull/782/head v0.1.31
baarkerlounger 2 years ago committed by GitHub
parent
commit
f7bba2f710
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/frontend/controllers/accessible_autocomplete_controller.js

2
app/frontend/controllers/accessible_autocomplete_controller.js

@ -6,7 +6,7 @@ import { enhanceOption, suggestion, sort } from '../modules/search'
export default class extends Controller {
connect () {
const selectEl = this.element
const selectOptions = Array.from(selectEl.options)
const selectOptions = Array.from(selectEl.options).filter(function (option, index, arr) { return option.value !== '' })
const options = selectOptions.map((o) => enhanceOption(o))
const matches = /^(\w+)\[(\w+)\]$/.exec(selectEl.name)

Loading…
Cancel
Save