Added button reset type.
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
f70270a0b3
commit
d287486165
2 changed files with 6 additions and 4 deletions
|
@ -17,7 +17,8 @@ function Button({
|
||||||
className={`${className ? `${className} ` : ''}btn-${variant} ${iconClass} noselect`}
|
className={`${className ? `${className} ` : ''}btn-${variant} ${iconClass} noselect`}
|
||||||
onMouseUp={(e) => blurOnBubbling(e, `.btn-${variant}`)}
|
onMouseUp={(e) => blurOnBubbling(e, `.btn-${variant}`)}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
type={type === 'button' ? 'button' : 'submit'}
|
// eslint-disable-next-line react/button-has-type
|
||||||
|
type={type}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
>
|
>
|
||||||
{iconSrc !== null && <RawIcon size="small" src={iconSrc} />}
|
{iconSrc !== null && <RawIcon size="small" src={iconSrc} />}
|
||||||
|
@ -42,7 +43,7 @@ Button.propTypes = {
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
variant: PropTypes.oneOf(['surface', 'primary', 'positive', 'caution', 'danger']),
|
variant: PropTypes.oneOf(['surface', 'primary', 'positive', 'caution', 'danger']),
|
||||||
iconSrc: PropTypes.string,
|
iconSrc: PropTypes.string,
|
||||||
type: PropTypes.oneOf(['button', 'submit']),
|
type: PropTypes.oneOf(['button', 'submit', 'reset']),
|
||||||
onClick: PropTypes.func,
|
onClick: PropTypes.func,
|
||||||
children: PropTypes.node.isRequired,
|
children: PropTypes.node.isRequired,
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
|
|
|
@ -17,7 +17,8 @@ const IconButton = React.forwardRef(({
|
||||||
className={`ic-btn ic-btn-${variant}`}
|
className={`ic-btn ic-btn-${variant}`}
|
||||||
onMouseUp={(e) => blurOnBubbling(e, `.ic-btn-${variant}`)}
|
onMouseUp={(e) => blurOnBubbling(e, `.ic-btn-${variant}`)}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
type={type === 'button' ? 'button' : 'submit'}
|
// eslint-disable-next-line react/button-has-type
|
||||||
|
type={type}
|
||||||
>
|
>
|
||||||
<RawIcon size={size} src={src} />
|
<RawIcon size={size} src={src} />
|
||||||
</button>
|
</button>
|
||||||
|
@ -45,7 +46,7 @@ IconButton.defaultProps = {
|
||||||
IconButton.propTypes = {
|
IconButton.propTypes = {
|
||||||
variant: PropTypes.oneOf(['surface', 'positive', 'caution', 'danger']),
|
variant: PropTypes.oneOf(['surface', 'positive', 'caution', 'danger']),
|
||||||
size: PropTypes.oneOf(['normal', 'small', 'extra-small']),
|
size: PropTypes.oneOf(['normal', 'small', 'extra-small']),
|
||||||
type: PropTypes.oneOf(['button', 'submit']),
|
type: PropTypes.oneOf(['button', 'submit', 'reset']),
|
||||||
tooltip: PropTypes.string,
|
tooltip: PropTypes.string,
|
||||||
tooltipPlacement: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
|
tooltipPlacement: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
|
||||||
src: PropTypes.string.isRequired,
|
src: PropTypes.string.isRequired,
|
||||||
|
|
Loading…
Reference in a new issue