Skip to content

Commit 8003283

Browse files
Merge pull request salesforce#1668 from kevinparkerson/counter-documentation-bugfix
Input counter example fix
2 parents d47e22d + 5f07ed8 commit 8003283

File tree

1 file changed

+73
-71
lines changed

1 file changed

+73
-71
lines changed

components/input/__examples__/counter-input.jsx

Lines changed: 73 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -16,77 +16,79 @@ class Example extends React.Component {
1616
return (
1717
<IconSettings iconPath="/assets/icons">
1818
<div>
19-
<h1 className="slds-text-title_caps slds-p-vertical_medium">
20-
1. Simple counter input
21-
</h1>
22-
<Input id="counter-input-1" label="My Label" variant="counter" />
23-
</div>
24-
<div>
25-
<h1 className="slds-text-title_caps slds-p-vertical_medium">
26-
2. Controlled counter input
27-
</h1>
28-
<Input
29-
id="counter-input-2"
30-
label="My Label"
31-
onChange={(event, data) => {
32-
this.setState({ counter2value: data.value });
33-
}}
34-
value={this.state.counter2value}
35-
variant="counter"
36-
/>
37-
</div>
38-
<div>
39-
<h1 className="slds-text-title_caps slds-p-vertical_medium">
40-
3. Controlled counter input with min/max values and custom step size
41-
</h1>
42-
<Input
43-
id="counter-input-3"
44-
label="My Label"
45-
minValue={2}
46-
maxValue={30}
47-
onChange={(event, data) => {
48-
this.setState({ counter3value: data.value });
49-
}}
50-
step={2}
51-
value={this.state.counter3value}
52-
variant="counter"
53-
/>
54-
</div>
55-
<div>
56-
<h1 className="slds-text-title_caps slds-p-vertical_medium">
57-
4. Counter input with floating step size
58-
</h1>
59-
<Input
60-
defaultValue={10.0}
61-
id="counter-input-4"
62-
label="My Label"
63-
step={0.1}
64-
variant="counter"
65-
/>
66-
</div>
67-
<div>
68-
<h1 className="slds-text-title_caps slds-p-vertical_medium">
69-
5. Disabled counter input
70-
</h1>
71-
<Input
72-
disabled
73-
id="counter-input-5"
74-
label="My Label"
75-
variant="counter"
76-
value="10"
77-
/>
78-
</div>
79-
<div>
80-
<h1 className="slds-text-title_caps slds-p-vertical_medium">
81-
6. Readonly counter input
82-
</h1>
83-
<Input
84-
id="counter-input-6"
85-
label="My Label"
86-
readOnly
87-
variant="counter"
88-
value="10"
89-
/>
19+
<div>
20+
<h1 className="slds-text-title_caps slds-p-vertical_medium">
21+
1. Simple counter input
22+
</h1>
23+
<Input id="counter-input-1" label="My Label" variant="counter" />
24+
</div>
25+
<div>
26+
<h1 className="slds-text-title_caps slds-p-vertical_medium">
27+
2. Controlled counter input
28+
</h1>
29+
<Input
30+
id="counter-input-2"
31+
label="My Label"
32+
onChange={(event, data) => {
33+
this.setState({ counter2value: data.value });
34+
}}
35+
value={this.state.counter2value}
36+
variant="counter"
37+
/>
38+
</div>
39+
<div>
40+
<h1 className="slds-text-title_caps slds-p-vertical_medium">
41+
3. Controlled counter input with min/max values and custom step size
42+
</h1>
43+
<Input
44+
id="counter-input-3"
45+
label="My Label"
46+
minValue={2}
47+
maxValue={30}
48+
onChange={(event, data) => {
49+
this.setState({ counter3value: data.value });
50+
}}
51+
step={2}
52+
value={this.state.counter3value}
53+
variant="counter"
54+
/>
55+
</div>
56+
<div>
57+
<h1 className="slds-text-title_caps slds-p-vertical_medium">
58+
4. Counter input with floating step size
59+
</h1>
60+
<Input
61+
defaultValue={10.0}
62+
id="counter-input-4"
63+
label="My Label"
64+
step={0.1}
65+
variant="counter"
66+
/>
67+
</div>
68+
<div>
69+
<h1 className="slds-text-title_caps slds-p-vertical_medium">
70+
5. Disabled counter input
71+
</h1>
72+
<Input
73+
disabled
74+
id="counter-input-5"
75+
label="My Label"
76+
variant="counter"
77+
value="10"
78+
/>
79+
</div>
80+
<div>
81+
<h1 className="slds-text-title_caps slds-p-vertical_medium">
82+
6. Readonly counter input
83+
</h1>
84+
<Input
85+
id="counter-input-6"
86+
label="My Label"
87+
readOnly
88+
variant="counter"
89+
value="10"
90+
/>
91+
</div>
9092
</div>
9193
</IconSettings>
9294
);

0 commit comments

Comments
 (0)