Skip to content

Commit

Permalink
one line fix :)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Oct 13, 2019
1 parent a389f50 commit 58827e1
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions docs/src/modules/components/AppFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,19 +182,8 @@ function AppFrame(props) {

changeTheme({ paletteType });
};

// these handlers used to fix issue with RTL tooltip staying open after click
const [directionTooltipOpen, setDirectionTooltipOpen] = React.useState(false);
const handleDirectionTooltipClose = () => {
setDirectionTooltipOpen(false);
};
const handleDirectionTooltipOpen = () => {
setDirectionTooltipOpen(true);
};

const handleToggleDirection = () => {
changeTheme({ direction: theme.direction === 'ltr' ? 'rtl' : 'ltr' });
setDirectionTooltipOpen(false);
};

const router = useRouter();
Expand Down Expand Up @@ -322,13 +311,7 @@ function AppFrame(props) {
{theme.palette.type === 'light' ? <Brightness4Icon /> : <Brightness7Icon />}
</IconButton>
</Tooltip>
<Tooltip
title={t('toggleRTL')}
enterDelay={300}
open={directionTooltipOpen}
onOpen={handleDirectionTooltipOpen}
onClose={handleDirectionTooltipClose}
>
<Tooltip title={t('toggleRTL')} key={theme.direction} enterDelay={300}>
<IconButton
color="inherit"
onClick={handleToggleDirection}
Expand Down

0 comments on commit 58827e1

Please sign in to comment.