Skip to content

Commit

Permalink
(CDPE-6335) Move trailing button after input text field
Browse files Browse the repository at this point in the history
  • Loading branch information
owenbeckles committed Mar 8, 2024
1 parent 042a5bf commit 0819e14
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## react-components 5.34.1 (2024-03-08)

- [Input] Bug fixing Input component element order

## data-grid 0.6.12 (2022-07-25)

- [Table] Bug fixing table loader width on selectable tables (by [@Lukeaber](https://github.com/Lukeaber) in [#636](https://github.com/puppetlabs/design-system/pull/636))
Expand Down
2 changes: 1 addition & 1 deletion packages/react-components/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/react-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@puppet/react-components",
"version": "5.34.0",
"version": "5.34.1",
"author": "Puppet, Inc.",
"license": "Apache-2.0",
"main": "build/library.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ const Input = ({
>
{icon && lIcon}
{trailingIcon && tIcon}
{showTrailingButton && trailingButton}
<Element
id={name}
name={name}
Expand All @@ -179,6 +178,7 @@ const Input = ({
onChange={e => onChange(parseValue(e.target.value), e)}
{...otherProps}
/>
{showTrailingButton && trailingButton}
</div>
);
};
Expand Down
5 changes: 5 additions & 0 deletions packages/react-components/test/input/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,9 @@ describe('<Input />', () => {

expect(onClick.called).to.equal(true);
});

it('should render the trailing icon button after the input element if trailingButtonIcon is provided', () => {
const wrapper = shallow(<Input {...requiredProps} trailingButtonIcon="eye" /> );
expect(wrapper.find('div').children().last().is('Button')).to.equal(true);
});
});

0 comments on commit 0819e14

Please sign in to comment.