Skip to content

Commit

Permalink
fix(button): do not apply context as element attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlo Bernardini committed Apr 18, 2019
1 parent 5490ba1 commit bba9668
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ exports[`<Alert> that renders an alert should have a button that works 1`] = `
>
<button
className="Button Button--context Button--context_link Button--size Button--size_normal"
context="link"
disabled={false}
onClick={[MockFunction]}
size="normal"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { block } = bem({
});

const Button = props => {
const { children, disabled, isBlock, isInline, type, ...rest } = props;
const { children, context, disabled, isBlock, isInline, type, ...rest } = props;

return (
<button {...rest} {...block(props)} type={type} disabled={disabled}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ exports[`<Button> that renders a button should add classes when props are change
>
<button
className="Button Button--context Button--context_primary Button--size Button--size_large Button--isBlock"
context="primary"
disabled={false}
size="large"
type="button"
Expand All @@ -34,7 +33,6 @@ exports[`<Button> that renders a button should render default button correctly 1
>
<button
className="Button Button--context Button--context_neutral Button--size Button--size_normal"
context="neutral"
disabled={false}
size="normal"
type="button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ exports[`<ButtonGroup> that renders a button should add classes when props are c
>
<button
className="Button Button--context Button--context_neutral Button--size Button--size_large ButtonGroup__button ButtonGroup__button--size ButtonGroup__button--size_large ButtonGroup__button--isBlock"
context="neutral"
disabled={false}
size="large"
type="button"
Expand All @@ -40,7 +39,6 @@ exports[`<ButtonGroup> that renders a button should add classes when props are c
>
<button
className="Button Button--context Button--context_neutral Button--size Button--size_large ButtonGroup__button ButtonGroup__button--size ButtonGroup__button--size_large ButtonGroup__button--isBlock"
context="neutral"
disabled={false}
size="large"
type="button"
Expand Down Expand Up @@ -72,7 +70,6 @@ exports[`<ButtonGroup> that renders a button should render default button correc
>
<button
className="Button Button--context Button--context_neutral Button--size Button--size_normal ButtonGroup__button ButtonGroup__button--size ButtonGroup__button--size_normal"
context="neutral"
disabled={false}
size="normal"
type="button"
Expand All @@ -92,7 +89,6 @@ exports[`<ButtonGroup> that renders a button should render default button correc
>
<button
className="Button Button--context Button--context_neutral Button--size Button--size_normal ButtonGroup__button ButtonGroup__button--size ButtonGroup__button--size_normal"
context="neutral"
disabled={false}
size="normal"
type="button"
Expand Down

0 comments on commit bba9668

Please sign in to comment.