From 85fef53b4c5ca810bb42c5cdb69df9e0e99e4646 Mon Sep 17 00:00:00 2001 From: tscz Date: Sun, 19 Jan 2020 15:42:53 +0900 Subject: [PATCH] #12 Fix issue with material UI tooltips on disabled items See https://github.com/mui-org/material-ui/issues/8416 --- src/pages/structure/structurePage.tsx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/pages/structure/structurePage.tsx b/src/pages/structure/structurePage.tsx index 7d21da5..ae2b75e 100644 --- a/src/pages/structure/structurePage.tsx +++ b/src/pages/structure/structurePage.tsx @@ -289,20 +289,20 @@ const WaveformControlButton = (props: { disabled?: boolean; onClick?: (e?: any) => void; }) => { - return ( - - <> - - {props.icon} - - - + const button = ( + + {props.icon} + ); + + if (props.disabled) return button; + + return {button}; }; const mapStateToProps = ({ project, audio, analysis }: ApplicationState) => {