Updated Button component mouseEnter/Leave handlers
• Updated: - Button component mouseEnter/Leave handlers
This commit is contained in:
parent
f0347b1c23
commit
742685bd82
@ -89,6 +89,18 @@ export default class Button extends PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleOnMouseEnter = () => {
|
||||||
|
if (!this.props.isDisabled && this.props.onMouseEnter) {
|
||||||
|
this.props.onMouseEnter()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
handleOnMouseLeave = () => {
|
||||||
|
if (!this.props.isDisabled && this.props.onMouseLeave) {
|
||||||
|
this.props.onMouseLeave()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setRef = (c) => {
|
setRef = (c) => {
|
||||||
try {
|
try {
|
||||||
this.node = c
|
this.node = c
|
||||||
@ -204,8 +216,8 @@ export default class Button extends PureComponent {
|
|||||||
|
|
||||||
const handlers = {
|
const handlers = {
|
||||||
onClick: !!onClick ? this.handleClick : undefined,
|
onClick: !!onClick ? this.handleClick : undefined,
|
||||||
onMouseEnter: !!onMouseEnter ? onMouseEnter : undefined,
|
onMouseEnter: !!onMouseEnter ? this.handleOnMouseEnter : undefined,
|
||||||
onMouseLeave: !!onMouseLeave ? onMouseLeave : undefined,
|
onMouseLeave: !!onMouseLeave ? this.handleOnMouseLeave : undefined,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tagName === 'NavLink' && !!to) {
|
if (tagName === 'NavLink' && !!to) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user