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

Add autosuggest filter to modify list container #2902

Merged
merged 8 commits into from
Aug 17, 2022
Merged

Conversation

JakePT
Copy link
Contributor

@JakePT JakePT commented Jul 22, 2022

Description of the Change

Add support for 2 'filter' functions modifying Autosuggest suggestions:

  • epAutosuggestListItemsHTMLFilter Filters the HTML that's added to the list when the suggestions are updated.
  • epAutosuggestElementFilter Filters the container element before it's added to the DOM.

Documentation with examples is included for both, and documentation with an example is also included for the existing epAutosuggestItemHTMLFilter function (closes #2776).

Closes #2811

How to test the Change

Implement the examples from the documentation updates and confirm that they work as expected.

Changelog Entry

Added - Autosuggest: filter the HTML of all results by defining a window.epAutosuggestListItemsHTMLFilter() function in JavaScript.
Added - Autosuggest: filter the container element by defining a window.epAutosuggestElementFilter() function in JavaScript.
Added - Documentation for Autosuggest JavaScript filters.

Credits

Props @JakePT

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@JakePT JakePT requested a review from felipeelia July 22, 2022 05:16
@JakePT JakePT self-assigned this Jul 22, 2022
@felipeelia felipeelia assigned felipeelia and JakePT and unassigned JakePT and felipeelia Jul 26, 2022
@felipeelia
Copy link
Member

Let's add #2909 to these docs as well @JakePT :)

@JakePT JakePT assigned felipeelia and unassigned JakePT Aug 9, 2022
@felipeelia felipeelia assigned brandwaffle and unassigned felipeelia Aug 9, 2022
@felipeelia felipeelia added this to the 4.3.0 milestone Aug 9, 2022
@felipeelia felipeelia merged commit c1232ea into develop Aug 17, 2022
@felipeelia felipeelia deleted the feature/2811 branch August 17, 2022 17:46
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

Successfully merging this pull request may close these issues.

Add autosuggest filter to modify list container Autosuggest: Document window.epAutosuggestItemHTMLFilter
3 participants