Skip to content

Commit

Permalink
feat: implement onMouseEnter and onMouseLeave props
Browse files Browse the repository at this point in the history
  • Loading branch information
gtallesb committed Nov 30, 2020
1 parent c325d65 commit aa3e18a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Button/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export interface ButtonProps extends BaseProps {
onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
onFocus?: (event: FocusEvent<HTMLElement>) => void;
onBlur?: (event: FocusEvent<HTMLElement>) => void;
onMouseEnter?: (event: MouseEvent<HTMLElement>) => void;
onMouseLeave?: (event: MouseEvent<HTMLElement>) => void;
ariaHaspopup?: boolean;
ariaControls?: string;
ariaExpanded?: boolean;
Expand Down
10 changes: 10 additions & 0 deletions src/components/Button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export default class Button extends Component {
onFocus,
onBlur,
onClick,
onMouseEnter,
onMouseLeave,
title,
type,
ariaHaspopup,
Expand Down Expand Up @@ -87,6 +89,8 @@ export default class Button extends Component {
onFocus={onFocus}
onBlur={onBlur}
onClick={onClick}
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
title={title}
type={type}
aria-haspopup={ariaHaspopup}
Expand Down Expand Up @@ -145,6 +149,10 @@ Button.propTypes = {
onFocus: PropTypes.func,
/** The action triggered when the element releases focus. */
onBlur: PropTypes.func,
/** The action triggered when moving the mouse pointer into the button. */
onMouseEnter: PropTypes.func,
/** The action triggered when moving the mouse pointer out of the button. */
onMouseLeave: PropTypes.func,
/** Indicates that the element has a popup context menu or sub-level menu. */
ariaHaspopup: PropTypes.bool,
/** A space-separated list of element IDs that
Expand Down Expand Up @@ -180,6 +188,8 @@ Button.defaultProps = {
onKeyDown: () => {},
onFocus: () => {},
onBlur: () => {},
onMouseEnter: () => {},
onMouseLeave: () => {},
ariaHaspopup: undefined,
className: undefined,
style: undefined,
Expand Down

0 comments on commit aa3e18a

Please sign in to comment.