Skip to content

Commit 64e63f2

Browse files
committed
fixes README issues, minor improvements
1 parent 8b9ce3a commit 64e63f2

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ _DatalistInput is intended to be easy to use and comes with default styling:_
88

99
```jsx
1010
import DatalistInput from 'react-datalist-input';
11-
import 'react-datalist-input/dist/style.css';
11+
import 'react-datalist-input/dist/styles.css';
1212

1313
const YourComponent = () => (
1414
<DatalistInput
@@ -147,7 +147,7 @@ import React, { useState, useMemo, useCallback } from 'react';
147147
// Import the DataListInput component
148148
import DataListInput from 'react-datalist-input';
149149
// Tntegrate the css file if you want to use the default styling
150-
import 'react-datalist-input/dist/style.css';
150+
import 'react-datalist-input/dist/styles.css';
151151

152152
const options = [
153153
{ name: 'Chocolate' },
@@ -192,7 +192,7 @@ const YourComponent = ({ options }) => {
192192

193193
### Styling
194194

195-
For simple use cases, you can use the default styling provided by this package: `import 'react-datalist-input/dist/style.css'`.
195+
For simple use cases, you can use the default styling provided by this package: `import 'react-datalist-input/dist/styles.css'`.
196196

197197
However, you can also customize the styling by providing your own CSS! Instead of importing the default stylesheet, create your own one. The following classes are available:
198198

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-datalist-input",
3-
"version": "3.0.1",
3+
"version": "3.0.2",
44
"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.",
55
"main": "dist/index.js",
66
"module": "dist/index.es.js",
@@ -79,6 +79,8 @@
7979
"build:css": "sass src/styles.scss dist/styles.css",
8080
"build": "npm run clean && npm run build:css && rollup -c",
8181
"prepublish": "npm run lint && npm run test && npm run build",
82-
"publish:package": "npm run prepublish && npm publish"
82+
"publish:package": "npm run prepublish && npm publish",
83+
"dev:css": "sass --watch src/styles.scss dist/styles.css",
84+
"dev": "rollup -c -w"
8385
}
8486
}

src/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ const useComboboxContext = () => useContext(ComboboxContext);
113113
* Use this hook to control the open state and input value of the combobox.
114114
* Pass the properties down to the DataListInput component.
115115
*/
116-
const useComboboxControls = ({ initialValue = '', ...params }: { isExpanded: boolean; initialValue?: string }) => {
117-
const [isExpanded, setIsExpanded] = useStateRef(params.isExpanded);
118-
const [value, setValue] = useState(initialValue);
116+
const useComboboxControls = (params?: { isExpanded: boolean; initialValue?: string }) => {
117+
const [isExpanded, setIsExpanded] = useStateRef(params?.isExpanded);
118+
const [value, setValue] = useState(params?.initialValue || '');
119119
return {
120120
isExpanded,
121121
value,

0 commit comments

Comments
 (0)