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 7, 2024
1 parent 042a5bf commit 02e09ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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 02e09ac

Please sign in to comment.