diff --git a/README.md b/README.md index 609f080..64324a2 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ to this element so that screen readers do not mistake this as an auto-complete o handles aria-live announcing number of search results so this should be purely decorative. ```html -
+ ``` ### A Note on Clear button @@ -91,7 +91,7 @@ As an example: ## Properties -- `fetchResult` you can override the default method used to query for results by overriding this property: `document.querySelector('auto-complete').fetchResult = async (el, url) => (await fetch(url)).text()` +- `fetchResult` you can override the default method used to query for results by overriding this property: `document.querySelector('auto-complete').fetchResult = async (url) => (await fetch(url)).text()` ## Events @@ -117,7 +117,7 @@ completer.addEventListener('error', () => container.classList.add('is-error')) ### Auto-complete events -**`auto-complete-change`** is dispatched after a value is selected. In `event.detail` you can find: +**`auto-complete-change`** is dispatched after a value is selected. In `event` you can find: - `relatedTarget`: The HTMLInputElement controlling the auto-complete result list. diff --git a/examples/index.html b/examples/index.html index bd89f1f..15a81a0 100644 --- a/examples/index.html +++ b/examples/index.html @@ -109,8 +109,8 @@ } return Promise.resolve(new Response(robotsList)); } - // fetchResult must be a function that return a Promise of string and that accepts as parameters an element and an URL - document.querySelector("auto-complete#custom-fetching-method").fetchResult = async (el, url) => (await fetch(url)).text(); + // fetchResult must be a function that return a Promise of string and that accepts as parameters a URL + document.querySelector("auto-complete#custom-fetching-method").fetchResult = async (url) => (await fetch(url)).text();