diff --git a/components/button/Button.js b/components/button/Button.js index 90634ea8..26fe3f40 100644 --- a/components/button/Button.js +++ b/components/button/Button.js @@ -101,6 +101,10 @@ const factory = (ripple, FontIcon) => { const element = href ? 'a' : 'button'; const level = this.getLevel(); const shape = this.getShape(); + const mouseEvents = { + onMouseUp: this.handleMouseUp, + onMouseLeave: this.handleMouseLeave, + }; const classes = classnames(theme.button, [theme[shape]], { [theme[level]]: neutral, @@ -110,21 +114,24 @@ const factory = (ripple, FontIcon) => { const props = { ...others, + ...mouseEvents, href, ref: (node) => { this.buttonNode = node; }, className: classes, disabled: this.props.disabled, - onMouseUp: this.handleMouseUp, - onMouseLeave: this.handleMouseLeave, type: !href ? type : null, 'data-react-toolbox': 'button', }; - return React.createElement(element, props, + const buttonElement = React.createElement(element, props, icon ? : null, label, children, ); + + return others.onMouseEnter && this.props.disabled + ? {buttonElement} + : buttonElement; } } diff --git a/spec/components/tooltip.js b/spec/components/tooltip.js index 691df86e..456c8862 100644 --- a/spec/components/tooltip.js +++ b/spec/components/tooltip.js @@ -20,6 +20,7 @@ const TooltipTest = () => (
Tooltip

Give information on :hover

+