Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
rename tooltip handlers
Browse files Browse the repository at this point in the history
Signed-off-by: Kerry Archibald <kerrya@element.io>
  • Loading branch information
Kerry Archibald committed Dec 7, 2021
1 parent 88189e5 commit 79ac8b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/components/views/elements/AccessibleTooltipButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ export default class AccessibleTooltipButton extends React.PureComponent<IToolti
}
}

onMouseOver = () => {
showTooltip = () => {
if (this.props.forceHide) return;
this.setState({
hover: true,
});
};

onMouseLeave = () => {
hideTooltip = () => {
this.setState({
hover: false,
});
Expand All @@ -78,10 +78,10 @@ export default class AccessibleTooltipButton extends React.PureComponent<IToolti
return (
<AccessibleButton
{...props}
onMouseOver={this.onMouseOver}
onMouseLeave={this.onMouseLeave}
onFocus={this.onMouseOver}
onBlur={this.onMouseLeave}
onMouseOver={this.showTooltip}
onMouseLeave={this.hideTooltip}
onFocus={this.showTooltip}
onBlur={this.hideTooltip}
aria-label={title}
>
{ children }
Expand Down
12 changes: 6 additions & 6 deletions src/components/views/elements/ActionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ export default class ActionButton extends React.Component<IProps, IState> {
};

private onMouseEnter = (): void => {
this.onShowTooltip();
this.showTooltip();
if (this.props.mouseOverAction) {
dis.dispatch({ action: this.props.mouseOverAction });
}
};

private onShowTooltip = (): void => {
private showTooltip = (): void => {
if (this.props.tooltip) this.setState({ showTooltip: true });
};

private onHideTooltip = (): void => {
private hideTooltip = (): void => {
this.setState({ showTooltip: false });
};

Expand All @@ -92,9 +92,9 @@ export default class ActionButton extends React.Component<IProps, IState> {
className={classNames.join(" ")}
onClick={this.onClick}
onMouseEnter={this.onMouseEnter}
onMouseLeave={this.onHideTooltip}
onFocus={this.onShowTooltip}
onBlur={this.onHideTooltip}
onMouseLeave={this.hideTooltip}
onFocus={this.showTooltip}
onBlur={this.hideTooltip}
aria-label={this.props.label}
>
{ icon }
Expand Down

0 comments on commit 79ac8b2

Please sign in to comment.