List to filterable list module

The 'FilterableList' module contains a (factory) function to convert a list of items (<ul>) or an element containing a <ul>-list to a filterable/searchable list of items. The list items (<li>) may contain html.
The function adds and handles a text input field - actually, the list to be filtered is wrapped in a div, containing the text input input field at the top of it. Handling the input field(s) uses event delegation.
There are two lists in the html document. They are marked to be searchable/filterable with a data-filterable attribute. The first list (flags) has this attribute on a <div> element, the second (fruits) on a <ul>-element.
In this document there are two ways to activate searching. The first is clicking the -icon to enable search for the concerning list.
The second is clicking 'Make all lists searchable'. In that case all lists in the document are wrapped by the module (imported as createSearchableList) using just one statement:
document.querySelectorAll(`[data-filterable]`).forEach(createSearchableList);

Flags from countries of the world

Fruits list