Skip to content

Commit

Permalink
#12 Fix issue with material UI tooltips on disabled items
Browse files Browse the repository at this point in the history
  • Loading branch information
tscz committed Jan 19, 2020
1 parent e1cba6d commit 85fef53
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/pages/structure/structurePage.tsx
Expand Up @@ -289,20 +289,20 @@ const WaveformControlButton = (props: {
disabled?: boolean;
onClick?: (e?: any) => void;
}) => {
return (
<Tooltip title={props.title}>
<>
<IconButton
onClick={props.onClick}
size="small"
style={{ marginTop: "8px", marginRight: "5px" }}
disabled={props.disabled}
>
{props.icon}
</IconButton>
</>
</Tooltip>
const button = (
<IconButton
onClick={props.onClick}
size="small"
style={{ marginTop: "8px", marginRight: "5px" }}
disabled={props.disabled}
>
{props.icon}
</IconButton>
);

if (props.disabled) return button;

return <Tooltip title={props.title}>{button}</Tooltip>;
};

const mapStateToProps = ({ project, audio, analysis }: ApplicationState) => {
Expand Down

0 comments on commit 85fef53

Please sign in to comment.