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
Copy file name to clipboardExpand all lines: README.md
+43-6Lines changed: 43 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ const YourComponent = () => {
51
51
52
52
## Installation
53
53
54
-
**Note: React 18 required!** Version 3.0.0 utilizes React 18. If you are using a React version below 18, install `[email protected]` instead! Find the documentation for version 2.2.1 [here](https://github.com/andrelandgraf/react-datalist-input/blob/bab05504c0dffa5f9343f2fcb5f075a38bad2512/README.md).
54
+
**Note: React 18 required!** Version 3.0.0 utilizes React 18. If you use React <=17, install `[email protected]` instead! Find the documentation for version 2.2.1 [here](https://github.com/andrelandgraf/react-datalist-input/blob/bab05504c0dffa5f9343f2fcb5f075a38bad2512/README.md).
55
55
56
56
### npm
57
57
@@ -78,7 +78,7 @@ A combobox renders a list of suggested values based on an input field. The user
78
78
79
79
If you don't care about custom functionality or advanced styling, consider using the native [datalist](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist) HTML5 element. If you require more control, then this package is for you!
80
80
81
-
You can also build something tailored to your own use case from scratch! Have a look at [w3schools.com](https://www.w3schools.com/howto/howto_js_autocomplete.asp) to see how you create a autocomplete control with pure HTML, CSS, and JS.
81
+
You can also build something tailored to your own use case from scratch! Have a look at [w3schools.com](https://www.w3schools.com/howto/howto_js_autocomplete.asp) to see how to create a autocomplete control with pure HTML, CSS, and JS.
82
82
83
83
## ARIA
84
84
@@ -149,6 +149,7 @@ import DataListInput from 'react-datalist-input';
149
149
// Tntegrate the css file if you want to use the default styling
150
150
import'react-datalist-input/dist/styles.css';
151
151
152
+
// Your data source
152
153
constoptions= [
153
154
{ name:'Chocolate' },
154
155
{ name:'Coconut' },
@@ -158,7 +159,7 @@ const options = [
158
159
];
159
160
160
161
constYourComponent= ({ options }) => {
161
-
const [item, setItem] =useState(); // The selectedItem
162
+
const [item, setItem] =useState(); // The selected item will be stored in this state.
162
163
163
164
/**
164
165
* The onSelect callback function is called if the user selects one option out of the dropdown menu.
@@ -222,7 +223,7 @@ For instance, display only the first three items in the list:
Use the `useComboboxControls` hook to get fine-grained control over the input value and the dropdown expansion states or just manage the value and expanded state yourself!
241
278
242
279
In this example, we utilize DatalistInput to act as a multi-select control:
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "react-datalist-input",
3
-
"version": "3.0.2",
3
+
"version": "3.0.4",
4
4
"description": "react-datalist-input provides a React datalist/combobox component called DatalistInput. The component contains an input field with a dropdown menu of suggestions based on the current input.",
0 commit comments