diff --git a/README.md b/README.md index 57e2ec3..6c6a762 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,8 @@ Here a table recapitulating the possible parameters to pass to `SearchModule`: If we keep the above example, we search among the elements that have the class "item". In order for the search bar to work properly, you absolutely need to add a specific attribute to each HTML element that has this class. If you don't do this, an exception will be thrown. This attribute is: `data-keywords`. In this attribute you can write the list of keywords that correspond to each item. +If an element doesn't have the attribute, an error will be thrown in the console (via `console.error()`). Therefore, this element will always be displayed whereas it does'nt correspond to what the user is looking at. + For example, we have a list of fruits: ``` @@ -60,7 +62,7 @@ For example, we have a list of fruits: Therefore, if the user writes "apple", only the last item will be displayed. However, if the user writes "framboise" or "strawberry", then the second element will be displayed. -For more details, I invite you to look at the example provided in the `src` folder. +For a concrete example, I invite you to look at the example provided in the `src` folder. ## License diff --git a/src/SearchModule.js b/src/SearchModule.js index 5ec61d2..e27ba1c 100644 --- a/src/SearchModule.js +++ b/src/SearchModule.js @@ -5,7 +5,6 @@ this.items = options.items; this.defaultDisplay = options.defaultDisplay || "block"; this.oninput = options.oninput; - this.onEnterKey = options.onEnterKey; if (!this.input || !this.items) { throw new Error("SearchModule(options) : input parameter and items parameter cannot be null.");