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
+14-3
Original file line number
Diff line number
Diff line change
@@ -112,7 +112,7 @@ Full refactor of react-datalist-input.
112
112
- Exposes helper hooks
113
113
- Exposes underlying components for full customization
114
114
115
-
**Note:** Be aware that version 3.0.0 includes breaking changes. Version 3.0.0 deprecates some properties from the DatalistInput component but all but one use case still be implemented in the new version (in a more intuitive way using the `useComboboxControls` hook). The only property that has been fully depcreated is `requiredInputLength`. Please create an [Issue](https://github.com/andrelandgraf/react-datalist-input/issues) if you need it!
115
+
**Note:** Be aware that version 3.0.0 includes breaking changes. Version 3.0.0 deprecates some properties from the DatalistInput component such as `requiredInputLength`. Instead of using custom properties for different use cases, you have now full control using the `useComboboxControls` hook and the `filters`property. Use plain React state and callbacks to control every aspect of the component's behavior!
// label: option.name, // use a custom label instead of the value
182
182
// node: option.name, // use a custom ReactNode to display the option
183
-
...option, // pass along any other properties, will be available in your onSelect callback
183
+
...option, // pass along any other properties to access in your onSelect callback
184
184
})),
185
185
[yourItems],
186
186
);
@@ -199,17 +199,27 @@ However, you can also customize the styling by providing your own CSS! Instead o
199
199
200
200
-`react-datalist-input__container`: For the container element.
201
201
-`react-datalist-input__textbox`: For the input element.
202
+
-`react-datalist-input__label`: For the label element.
202
203
-`react-datalist-input__listbox`: For the dropdown list.
203
204
-`react-datalist-input__listbox-option`: For each option in the dropdown list.
204
205
205
-
**Note:** To get up and running quickly, just copy-paste the default stylesheet and adapt the pieces you need.
206
+
**Note:** Use the focus and hover states of `react-datalist-input__listbox-option` to show the user some visual feedback.
207
+
208
+
```css
209
+
.react-datalist-input__listbox-option:focus {
210
+
background-color: gray;
211
+
}
212
+
```
213
+
214
+
**Tip:** To get up and running quickly, just copy-paste the default stylesheet and adapt the pieces you need.
206
215
207
216
#### Tailwind CSS / Utility Classes
208
217
209
218
Alternatively, you can also pass custom classes to each element of the DatalistInput component by using the following props:
210
219
211
220
-`className`: For the container element.
212
221
-`inputProps["className"]`: For the input element.
222
+
-`labelProps["className"]`: For the label element.
213
223
-`listboxProps["className"]`: For the dropdown list.
214
224
-`listboxOptionProps["className"]`: For each option in the dropdown list.
215
225
-`isExpandedClassName`: Applied to the dropdown list if it is expanded.
@@ -348,6 +358,7 @@ DatalistInput accepts the following properties:
348
358
-`selectedItem`: The currently selected item. Important for ARIA. DatalistInput keeps track of the last selected item. You only need to provide this prop if you want to change the selected item outside of the component.
349
359
-`inputProps`: An object of props to pass to the combobox input element.
350
360
-`listboxProps`: An object of props to pass to the listbox element.
361
+
-`labelProps`: An object of props to pass to the label element.
351
362
-`listboxOptionProps`: An object of props to pass to the listbox option elements.
352
363
-`isExpandedClassName`: The class name applied to the listbox element if it is expanded.
353
364
-`isCollapsedClassName`: The class name applied to the listbox element if it is collapsed.
Copy file name to clipboardExpand all lines: package.json
+1-1
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.5",
3
+
"version": "3.0.6",
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