Skip to content

Commit ae9d5e6

Browse files
committed
Fix typos and simplify README
1 parent d7cf629 commit ae9d5e6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import 'react-dual-listbox/lib/react-dual-listbox.css';
4141

4242
### Render Component
4343

44-
The `DualListBox` is a [controlled][react-controlled] component, so you have to update the `selected` property in conjunction with the `onChange` handler if you want the selected values to change.
44+
The `DualListBox` is a [controlled][react-controlled] component. You must update the `selected` property in conjunction with the `onChange` handler if you want the selected values to change.
4545

4646
Here is a minimal rendering of the component:
4747

@@ -62,15 +62,15 @@ function Widget() {
6262
<DualListBox
6363
options={options}
6464
selected={selected}
65-
onChange={(value) => setSelected(value)}
65+
onChange={(newValue) => setSelected(newValue)}
6666
/>
6767
);
6868
}
6969
```
7070

7171
### Optgroups
7272

73-
Traditional `<optgroup>`'s are also supported:
73+
This component also supports traditional `<optgroup>` elements through the use of the `options` key:
7474

7575
``` jsx
7676
const options = [
@@ -137,7 +137,7 @@ You can enable filtering of available and selected options by merely passing in
137137
<DualListBox canFilter options={options} />
138138
```
139139

140-
Optionally, you can also override the default filter placeholder text and the filtering function:
140+
Optionally, you can also override the default filtering function:
141141

142142
``` jsx
143143
<DualListBox
@@ -153,7 +153,7 @@ Optionally, you can also override the default filter placeholder text and the fi
153153
/>
154154
```
155155

156-
In addition, you can control the filter search text, rather than leaving it up to the component:
156+
In addition, you may control the filter text state, rather than leaving it up to the component:
157157

158158
``` jsx
159159
<DualListBox
@@ -164,14 +164,14 @@ In addition, you can control the filter search text, rather than leaving it up t
164164
}}
165165
options={options}
166166
onFilterChange={(filter) => {
167-
console.log(filter;
167+
console.log(filter);
168168
}}
169169
/>
170170
```
171171

172172
### Action/Button Alignment
173173

174-
By default, the component arranges movement buttons to the center. Another option is to align these actions to be above their respective lists:
174+
By default, the component arranges the action buttons to the center. Another option is to align these actions to be above their respective lists:
175175

176176
``` jsx
177177
<DualListBox alignActions="top" options={options} />
@@ -181,7 +181,7 @@ By default, the component arranges movement buttons to the center. Another optio
181181

182182
By default, `react-dual-listbox` will order any selected items according to the order of the `options` property. There may be times in which you wish to preserve the selection order instead. In this case, you can add the `preserveSelectOrder` property.
183183

184-
> **Note** &ndash; Any `<optgroup>`'s supplied will not be surfaced when preserving the selection order.
184+
> **Note** &ndash; Enabling this option hides `<optgroup>` associations in the selected listbox.
185185
186186
``` jsx
187187
<DualListBox options={options} preserveSelectOrder />

0 commit comments

Comments
 (0)