Working type submit for forms - Button Component

This commit is contained in:
Belen Curcio
2018-08-16 12:41:21 -03:00
parent a48bcc3076
commit ecb82cf9a9
3 changed files with 22 additions and 4 deletions
@@ -36,6 +36,8 @@ interface InnerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
/** If set renders active state e.g. to implement toggle buttons */
active?: boolean;
type?: "submit" | "reset" | "button";
/** Internal: Forwarded Ref */
forwardRef?: Ref<HTMLButtonElement>;
}
@@ -57,9 +59,12 @@ export class Button extends React.Component<InnerProps> {
disabled,
forwardRef,
variant,
type,
...rest
} = this.props;
console.log("type", type, "---------");
const rootClassName = cn(classes.root, className, {
[classes.sizeRegular]: size === "regular",
[classes.sizeSmall]: size === "small",
@@ -84,6 +89,7 @@ export class Button extends React.Component<InnerProps> {
classes={pick(classes, "keyboardFocus", "mouseHover")}
disabled={disabled}
forwardRef={forwardRef}
type={type}
{...rest}
/>
);