Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
Fixed page's refresh after 'Cancel' on CreateComment. Make Button to …
Browse files Browse the repository at this point in the history
…have type='button' by default.
  • Loading branch information
artkravchenko committed Jul 24, 2016
1 parent 6c0d847 commit 57fb6e6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@
*/
import React, { PropTypes } from 'react';

const Button = ({ color, size, className, waiting, title, ...props }) => {
const Button = ({ color, size, className, waiting, title, type, ...props }) => {
let icon = null;
let cn = 'button action';
let t = 'button';

if (type) {
t = type;
}

if (className) {
cn += ` ${className}`;
Expand All @@ -43,7 +48,7 @@ const Button = ({ color, size, className, waiting, title, ...props }) => {
}

return (
<button className={cn} title={title} {...props}>
<button className={cn} title={title} type={t} {...props}>
{icon}
{title}
</button>
Expand All @@ -57,6 +62,7 @@ Button.propTypes = {
color: PropTypes.string,
size: PropTypes.string,
title: PropTypes.string,
type: PropTypes.oneOf(['button', 'reset', 'submit']),
waiting: PropTypes.bool
};

Expand Down

0 comments on commit 57fb6e6

Please sign in to comment.