Skip to content

Commit 7704e9b

Browse files
authored
Move all documentation out of code and into readme and add example
1 parent 1e84e52 commit 7704e9b

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,13 @@ When a label is clicked on, `click` event is fired from both `<label>` and its a
7272

7373
For advanced configuration, the constructor takes an optional third argument. This is a settings object with the following setting:
7474

75-
<dl>
76-
<dt><code>tabInsertsSuggestions: boolean = true</code></dt>
77-
<dd>Control whether the highlighted suggestion is inserted when <kbd>Tab</kbd> is pressed.</dd>
78-
</dl>
75+
- `tabInsertsSuggestions: boolean = true` - Control whether the highlighted suggestion is inserted when <kbd>Tab</kbd> is pressed (<kbd>Enter</kbd> will always insert a suggestion regardless of this setting). When `true`, tab-navigation will be hijacked when open (which can have negative impacts on accessibility) but the combobox will more closely imitate a native IDE experience.
76+
77+
For example:
78+
79+
```js
80+
const combobox = new Combobox(input, list, {tabInsertsSuggestions: true})
81+
```
7982

8083
## Development
8184

src/index.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
export type ComboboxSettings = {
2-
/**
3-
* Control whether pressing the `Tab` key should insert a suggestion (`Enter` will always
4-
* insert a suggestion regardless of this setting). When `true`, tab-navigation will be
5-
* hijacked when open (which can have negative impacts on accessibility) but the combobox
6-
* will more closely imitate a native IDE experience.
7-
*
8-
* Defaults to `true`.
9-
*/
102
tabInsertsSuggestions?: boolean
113
}
124

0 commit comments

Comments
 (0)