Skip to content

Commit

Permalink
Merge pull request #344 from Capgemini/revert-342-feature/button-value
Browse files Browse the repository at this point in the history
Revert "feat: button-value"
  • Loading branch information
daniele-zurico authored Sep 20, 2022
2 parents 94d80f6 + 2a57460 commit 1e58be9
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 16 deletions.
6 changes: 0 additions & 6 deletions src/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ type ButtonProps = React.HTMLAttributes<HTMLButtonElement> & {
* allow the user to define the buttons name
*/
name?: string;
/**
* allow the user to define the button value
*/
value?: string | number;
};

export const Button = ({
Expand All @@ -85,7 +81,6 @@ export const Button = ({
customLoadingPostImage,
formAction,
name,
value,
...props
}: ButtonProps) => {
const [disable, setDisable] = React.useState<boolean>(disabled);
Expand Down Expand Up @@ -135,7 +130,6 @@ export const Button = ({
aria-label={ariaLabel}
formAction={formAction}
name={name}
value={value}
{...props}
>
{prefix}
Expand Down
7 changes: 0 additions & 7 deletions src/button/__tests__/Button.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,4 @@ describe('Button', () => {
const button: any = screen.getByRole('button');
expect(button.getAttribute('name')).toBe('submit');
});

it('should accept value as attribute', () => {
const handleClick = jest.fn();
render(<Button onClick={handleClick} value='buttonValue'/>);
const button: any = screen.getByRole('button');
expect(button.getAttribute('value')).toBe('buttonValue');
});
});
3 changes: 1 addition & 2 deletions stories/Button/Documentation.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ An example with all the available properties is:
onClick={buttonHandler}
disableClickForMs={2000}
disable={true}
isLoading={true}
value={value}
isLoading={true},
loadingLabel="loading..."
customLoadingPreImage={<span>spinner</span>}
customLoadingPostImage={<span>spinner</span>}
Expand Down
1 change: 0 additions & 1 deletion stories/liveEdit/ButtonLive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function ButtonDemo() {
customPostfixImg={<></>}
customPrefixImg={<></>}
isLoading={isLoading}
value={value}
loadingLabel="saving..."
customLoadingPreImage={<></>}
customLoadingPostImage={<></>}
Expand Down

0 comments on commit 1e58be9

Please # to comment.