Browse Source

Add a check for matches

pull/728/head
Kat 3 years ago
parent
commit
9e264ea9e0
  1. 2
      app/frontend/controllers/accessible_autocomplete_controller.js

2
app/frontend/controllers/accessible_autocomplete_controller.js

@ -10,7 +10,7 @@ export default class extends Controller {
const options = selectOptions.map((o) => enhanceOption(o)) const options = selectOptions.map((o) => enhanceOption(o))
const matches = /^(\w+)\[(\w+)\]$/.exec(selectEl.name) const matches = /^(\w+)\[(\w+)\]$/.exec(selectEl.name)
const rawFieldName = `${matches[1]}[${matches[2]}_raw]` const rawFieldName = matches ? `${matches[1]}[${matches[2]}_raw]` : ''
accessibleAutocomplete.enhanceSelectElement({ accessibleAutocomplete.enhanceSelectElement({
defaultValue: '', defaultValue: '',

Loading…
Cancel
Save