You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- rewrites DataListInput as a functional component
- changes version to 2.0.0
- describes versioning in README
- adds more unit tests
- adds snapshot tests
- adds better a11y support by adding aria-labels and roles
// turn it off for JS and JSX, we will do this via eslint
5
+
"[javascript]": {
6
+
"editor.formatOnSave": false
7
+
},
8
+
"[javascriptreact]": {
9
+
"editor.formatOnSave": false
10
+
},
11
+
// tell the ESLint plugin to run on save
12
+
"editor.codeActionsOnSave": {
13
+
"source.fixAll": true
14
+
},
15
+
// Optional BUT IMPORTANT: If you have the prettier extension enabled for other languages like CSS and HTML, turn it off for JS since we are doing it through Eslint already
Copy file name to clipboardExpand all lines: README.md
+83-82Lines changed: 83 additions & 82 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
## Info
2
2
3
-
This package provides a single react component. The component contains an input field with a drop down menu to pick a possible option based on the current input as a react component.
3
+
This package provides a single React component. The component contains an input field with a drop down menu to pick a possible option based on the current input as a React component.
4
4
5
-
Have a look at [w3schools.com](https://www.w3schools.com/howto/howto_js_autocomplete.asp) to see how you can do something similar with pure html, css, and js. For more information about react and the ecosystem see this [guide](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md).
5
+
Have a look at [w3schools.com](https://www.w3schools.com/howto/howto_js_autocomplete.asp) to see how you can do something similar with pure html, css, and js. For more information about React and the ecosystem see this [guide](https://reactjs.org/docs/getting-started.html).
6
6
7
7
## Demo
8
8
@@ -12,121 +12,121 @@ Check it out on [my personal website](https://andre-landgraf.cool/uses)!
12
12
13
13
Feel free to get inspired and more importantly please provide [your feedback](https://github.com/andrelandgraf/react-datalist-input/issues) on structure and style.
14
14
15
-
### Using Gatsby or Next.js?
15
+
### Using Gatsby or Next.js?
16
16
17
17
This component is not compatible with server-side rendering since it has css bundled with it.
18
18
19
19
I created a plain version of this package without css. Find more information [here](https://www.npmjs.com/package/react-plain-datalist-input).
20
20
21
+
## Versions
22
+
23
+
- Version 2.x.x serves a functional component using hooks
24
+
- Version 1.x.x serves a class component
25
+
26
+
The documentation below mainly applies for both versions but will be updated based on version 2.x.x updates in the future.
27
+
21
28
## Installation
22
29
23
30
### Installation via npm
24
31
25
32
```bash
26
-
npm install react-datalist-input --save
33
+
npm i react-datalist-input
27
34
```
28
35
29
36
### Basic Usage
30
37
31
38
```javascript
32
-
importDataListInputfrom'react-datalist-input';
33
-
34
-
/**
35
-
* OPTIONAL, this packages comes with a simple default label matching function
36
-
* but feel free to create your own match algorithm if you want to do so
37
-
* @param{String}currentInput (the current user input)
38
-
* @param{object}item (one item of the items array)
@@ -218,7 +222,6 @@ and supports uses cases like saving user state or suggesting a search value.
218
222
- If you still have performance issues even when using a `debounceTime={3000}` or higher, you might want to consider using another package / user input instead. Think about a "search/look-up"-button next to your input field or even consider running the search functionality in a dedicated backend.
219
223
- Default is zero which means no timeout/debouncing is used.
0 commit comments