diff --git a/src/components/Button/index.jsx b/src/components/Button/index.jsx index 37bc29a20..fb87306be 100644 --- a/src/components/Button/index.jsx +++ b/src/components/Button/index.jsx @@ -9,7 +9,7 @@ import { expandDts } from '../../lib/utils'; import './styles.scss'; const Button = props => { - const { bsSize, bsStyle, children, className, disabled, dts, href, inverse, isLoading, size, target } = props; + const { bsSize, bsStyle, children, className, disabled, dts, href, inverse, isLoading, size, target, type } = props; const baseClass = 'aui--button'; const classes = classNames( baseClass, @@ -49,6 +49,7 @@ const Button = props => { data-testid="button-wrapper" disabled={isLoading || disabled} className={classes} + type={type} {...expandDts(dts)} {..._.omit(props, _.keys(adslotButtonPropTypes))} > @@ -83,6 +84,10 @@ const adslotButtonPropTypes = { * PropTypes.oneOf(['small', 'large']) */ size: PropTypes.oneOf(['small', 'large']), + /** + * PropTypes.oneOf(['button', 'reset', 'submit']) + */ + type: PropTypes.oneOf(['button', 'reset', 'submit']), }; Button.propTypes = { ...adslotButtonPropTypes }; @@ -93,6 +98,7 @@ Button.defaultProps = { size: 'small', bsStyle: 'default', target: '_self', + type: 'button', }; export default Button; diff --git a/src/components/ConfirmModal/__snapshots__/index.spec.jsx.snap b/src/components/ConfirmModal/__snapshots__/index.spec.jsx.snap index 0d0304a48..e39ab1dcc 100644 --- a/src/components/ConfirmModal/__snapshots__/index.spec.jsx.snap +++ b/src/components/ConfirmModal/__snapshots__/index.spec.jsx.snap @@ -31,6 +31,7 @@ exports[` should show modal when \`show\` is true 1`] = ` class="aui--button btn-primary" data-test-selector="confirm-modal-confirm" data-testid="confirm-modal-confirm" + type="button" >
- +
+ +
); ```