Skip to content

Commit

Permalink
fix(Input): icon should be always after <input> (#2302)
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter authored and levithomason committed Nov 16, 2017
1 parent bf27992 commit 21ebc89
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/elements/Input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ class Input extends Component {
// Render Shorthand
// ----------------------------------------
const actionElement = Button.create(action)
const iconElement = Icon.create(this.computeIcon())
const labelElement = Label.create(label, {
defaultProps: {
className: cx(
Expand All @@ -236,11 +235,10 @@ class Input extends Component {
return (
<ElementType {...rest} className={classes}>
{actionPosition === 'left' && actionElement}
{iconPosition === 'left' && iconElement}
{labelPosition !== 'right' && labelElement}
{createHTMLInput(input || type, { defaultProps: htmlInputProps })}
{actionPosition !== 'left' && actionElement}
{iconPosition !== 'left' && iconElement}
{Icon.create(this.computeIcon())}
{labelPosition === 'right' && labelElement}
</ElementType>
)
Expand Down
2 changes: 1 addition & 1 deletion test/specs/elements/Input/Input-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ describe('Input', () => {
propKey: 'action',
})
common.implementsCreateMethod(Input)
common.implementsIconProp(Input)
common.implementsLabelProp(Input, {
shorthandDefaultProps: { className: 'label' },
})
Expand All @@ -85,7 +86,6 @@ describe('Input', () => {
common.propKeyOnlyToClassName(Input, 'loading', { className: 'icon' })
common.propKeyOnlyToClassName(Input, 'transparent')
common.propKeyOnlyToClassName(Input, 'icon')
common.propKeyOnlyToClassName(Input, 'icon')

common.propValueOnlyToClassName(Input, 'size', SUI.SIZES)

Expand Down

0 comments on commit 21ebc89

Please sign in to comment.