Skip to content
This repository was archived by the owner on Oct 19, 2021. It is now read-only.

Commit 853c04c

Browse files
marijohannessenjoshblack
authored andcommitted
fix(components): fixed some issues with the inputs (#960)
* fix(components): fixed some order issues on the inputs * fix(package): reverted back to version * fix(number-input): arrows being off on invalid * fix(number-input): fixed failing test * fix(number-inputs): actually fixed tests
1 parent da70eb9 commit 853c04c

File tree

7 files changed

+23
-23
lines changed

7 files changed

+23
-23
lines changed

src/components/DatePickerInput/DatePickerInput.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ export default class DatePickerInput extends Component {
9797

9898
return (
9999
<div className="bx--date-picker-container">
100-
{label}
101100
{datePickerIcon}
102101
{input}
102+
{label}
103103
{error}
104104
</div>
105105
);

src/components/NumberInput/NumberInput-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ describe('NumberInput', () => {
191191
);
192192

193193
const input = wrapper.find('input');
194-
const upArrow = wrapper.find('.up-icon').parent();
195-
const downArrow = wrapper.find('.down-icon').parent();
194+
const upArrow = wrapper.find('button.up-icon');
195+
const downArrow = wrapper.find('button.down-icon');
196196

197197
it('should be disabled when numberInput is disabled', () => {
198198
expect(upArrow.prop('disabled')).toEqual(true);

src/components/NumberInput/NumberInput.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ export default class NumberInput extends Component {
149149
const buttonProps = {
150150
disabled,
151151
type: 'button',
152-
className: 'bx--number__control-btn',
153152
};
154153

155154
const inputWrapperProps = {};
@@ -161,41 +160,43 @@ export default class NumberInput extends Component {
161160

162161
return (
163162
<div className="bx--form-item">
164-
<label htmlFor={id} className="bx--label">
165-
{label}
166-
</label>
167163
<div className={numberInputClasses} {...inputWrapperProps}>
168-
<input
169-
type="number"
170-
pattern="[0-9]*"
171-
{...other}
172-
{...props}
173-
ref={this._handleInputRef}
174-
/>
175164
<div className="bx--number__controls">
176165
<button
166+
className="bx--number__control-btn up-icon"
177167
{...buttonProps}
178168
onClick={evt => this.handleArrowClick(evt, 'up')}>
179169
<Icon
180170
className="up-icon"
181171
name="caret--up"
182172
description={this.props.iconDescription}
183-
viewBox="0 2 10 5"
173+
viewBox="0 0 10 5"
184174
/>
185175
</button>
186176
<button
177+
className="bx--number__control-btn down-icon"
187178
{...buttonProps}
188179
onClick={evt => this.handleArrowClick(evt, 'down')}>
189180
<Icon
190181
className="down-icon"
191182
name="caret--down"
192-
viewBox="0 2 10 5"
183+
viewBox="0 0 10 5"
193184
description={this.props.iconDescription}
194185
/>
195186
</button>
196187
</div>
188+
<input
189+
type="number"
190+
pattern="[0-9]*"
191+
{...other}
192+
{...props}
193+
ref={this._handleInputRef}
194+
/>
195+
<label htmlFor={id} className="bx--label">
196+
{label}
197+
</label>
198+
{error}
197199
</div>
198-
{error}
199200
</div>
200201
);
201202
}

src/components/TextArea/TextArea.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ const TextArea = ({
5858

5959
return (
6060
<div className="bx--form-item">
61-
{label}
6261
{input}
62+
{label}
6363
{error}
6464
</div>
6565
);

src/components/TextInput/TextInput.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ const TextInput = ({
6767

6868
return (
6969
<div className="bx--form-item">
70-
{label}
7170
{input}
71+
{label}
7272
{error}
7373
</div>
7474
);

src/components/TimePicker/TimePicker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ export default class TimePicker extends Component {
129129

130130
return (
131131
<div className="bx--form-item">
132-
{label}
133132
<div className={timePickerClasses}>
134133
<div className="bx--time-picker__input">
135134
<input
@@ -138,6 +137,7 @@ export default class TimePicker extends Component {
138137
data-invalid={invalid ? invalid : undefined}
139138
className="bx--time-picker__input-field"
140139
/>
140+
{label}
141141
{error}
142142
</div>
143143
{children}

yarn.lock

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2761,9 +2761,8 @@ caniuse-lite@^1.0.30000791, caniuse-lite@^1.0.30000792:
27612761
version "1.0.30000792"
27622762
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000792.tgz#d0cea981f8118f3961471afbb43c9a1e5bbf0332"
27632763

2764-
carbon-components@^8.20.0:
2765-
version "8.23.0"
2766-
resolved "https://registry.yarnpkg.com/carbon-components/-/carbon-components-8.23.0.tgz#928a6b600d705b1a9a746de4739074f5599aa271"
2764+
"carbon-components@file:../carbon-components":
2765+
version "7.2.1"
27672766
dependencies:
27682767
carbon-icons "^6.0.4"
27692768
flatpickr "2.6.3"

0 commit comments

Comments
 (0)