Skip to content

Add modifyList option to the autocomplete element#9548

Merged
andreslucena merged 3 commits intodecidim:developfrom
mainio:feature/autocomplete-modify-list
Jul 13, 2022
Merged

Add modifyList option to the autocomplete element#9548
andreslucena merged 3 commits intodecidim:developfrom
mainio:feature/autocomplete-modify-list

Conversation

@ahukkanen
Copy link
Copy Markdown
Contributor

🎩 What? Why?

While upgrading term customizer, I noticed that there is no event triggered when the autocomplete result list is updated if it is already open. This required some hacky ways to listen to the changes in the list through MutationObserver as shown here:
https://github.com/mainio/decidim-module-term_customizer/blob/cb170d6e88ada190bf5f6946ad5f688995b6cffb/app/packs/src/decidim/term_customizer/admin/translations_admin.js#L66-L72

This PR provides a new modifyList option for the autocomplete which is called every time when the list is modified, i.e. updated. This would've allowed avoiding such hack in the term customizer.

In other words, this exposes the resultsList.element option at the autocomplete.js to the Decidim autocomplete implementation, as explained at:
https://tarekraafat.github.io/autoComplete.js/#/configuration?id=resultslist-optional

📌 Related Issues

Testing

Try to listen to an event in the autocomplete element without a MutationObserver.

@ahukkanen ahukkanen requested a review from andreslucena July 8, 2022 15:42
Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏽

@andreslucena andreslucena merged commit 5795f3a into decidim:develop Jul 13, 2022
@ahukkanen ahukkanen deleted the feature/autocomplete-modify-list branch July 13, 2022 10:56
entantoencuanto added a commit that referenced this pull request Jul 15, 2022
…ging

* feature/redesign-main-footer:
  Reorder elements in main links of footer and define links and texts
  Define a cell for static_pages and topics configured to appear in footer
  Fix translation call
  Set fixed links in redesigned_main_legal partial
  Add FooterMenuPresenter to display menu items in footer
  Fix budgets seeds on non development apps (#9585)
  Return 404 when there isn't a valid component in program (#9576)
  Add missing queue close_meeting_reminder to sidekiq configuration (#9568)
  Make the HERE Map display in the currently selected language (#9552)
  Add help text for proposals' 'publish answers immediately' setting  (#9549)
  Fix admin language selector with more than 4 locales (#9519)
  Fix publish event on official proposals (#9421)
  Prevent missing ActionLog entries to break the application (#9502)
  Add boilerplate structure to CHANGELOG (#9501)
  Add step-by-step instructions of the Crowdin releases process (#9555)
  Fix translated attributes field type change (#9547)
  Add `modifyList` option to the autocomplete element (#9548)
  Admin log filters (#9460)
  Improve the default gitignore files created by the generators (#9507)
eliegaboriau pushed a commit to eliegaboriau/decidim that referenced this pull request Oct 25, 2022
* Add `modifyList` option to the autocomplete element

* Increase the max-lines eslint rule to fix the linting issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants