Skip to content

Commit

Permalink
fix(Input): fixes number arrows
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Firsov committed Apr 30, 2019
1 parent c5b3ca9 commit 9cbb64f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/Input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ class Input extends PureComponent<InputProps> {
modifiers={ rest }
mask={ mask }
tagName={ mask ? InputMask : 'input' }
hideNumberArrows={ hideNumberArrows }
/>
<If condition={ !!hasError && !hideErrorIndicator }>
<InputIndicatorTag modifiers={ rest } hasError={ hasError } tagName="div" />
Expand Down
8 changes: 7 additions & 1 deletion src/components/Input/Input.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe('<Input />', () => {
hasError={false}
hasLeftIcon={true}
hasRightIcon={false}
hideNumberArrows={true}
kind="bordered"
modifiers={
Object {
Expand Down Expand Up @@ -100,7 +101,12 @@ describe('<Input />', () => {
it('should increment and decrement number on arrows click', () => {
const onChange = jest.fn();
const wrapper = mount(
<Input value="" onChange={ onChange } type="number" hideNumberArrows={ false } />,
<Input
value=""
onChange={ onChange }
type="number"
hideNumberArrows={ false }
/>,
);

// From "" (0) to 1
Expand Down
2 changes: 1 addition & 1 deletion src/components/Input/Input.theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const [InputTag, themeInput] = createThemeTag(name, ({ COLORS, SIZES }: *): * =>
width: props.width ? `${props.width}rem` : props.stretch ? '100%' : '172px',
outline: 'none',
paddingLeft: props.hasLeftIcon ? '36px' : '8px',
paddingRight: props.hasRightIcon || props.type === 'number' ? '48px' : '16px',
paddingRight: props.hasRightIcon || (props.type === 'number' && !props.hideNumberArrows) ? '48px' : '16px',

backgroundColor: (props.disabled || props.readOnly)
? COLORS.LIGHT_GRAY5
Expand Down

0 comments on commit 9cbb64f

Please sign in to comment.