Skip to content

Commit

Permalink
Prevent ChapterCard height change on selection
Browse files Browse the repository at this point in the history
Due to the Checkbox being smaller than the vertical menu icon the ChapterCard was reduced in height, which caused the chapters in the list to jump up sightly.

This issue was introduced by 0ab6549 due to changing the line height of the chapter name
  • Loading branch information
schroda committed May 23, 2024
1 parent 1b408c8 commit af9e775
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions src/components/chapter/ChapterCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,26 +128,28 @@ export const ChapterCard: React.FC<IProps> = (props: IProps) => {

{dc && <DownloadStateIndicator download={dc} />}

{selected === null ? (
<Tooltip title={t('global.button.options')}>
<IconButton
ref={menuButtonRef}
{...bindTrigger(popupState)}
onClick={(e) => handleClickOpenMenu(e, popupState.open)}
onTouchStart={(e) => handleClickOpenMenu(e, popupState.open)}
aria-label="more"
size="large"
<Stack sx={{ minHeight: '48px' }}>
{selected === null ? (
<Tooltip title={t('global.button.options')}>
<IconButton
ref={menuButtonRef}
{...bindTrigger(popupState)}
onClick={(e) => handleClickOpenMenu(e, popupState.open)}
onTouchStart={(e) => handleClickOpenMenu(e, popupState.open)}
aria-label="more"
size="large"
>
<MoreVertIcon />
</IconButton>
</Tooltip>
) : (
<Tooltip
title={t(selected ? 'global.button.deselect' : 'global.button.select')}
>
<MoreVertIcon />
</IconButton>
</Tooltip>
) : (
<Tooltip
title={t(selected ? 'global.button.deselect' : 'global.button.select')}
>
<Checkbox checked={selected} />
</Tooltip>
)}
<Checkbox checked={selected} />
</Tooltip>
)}
</Stack>
</CardContent>
</CardActionArea>
</Card>
Expand Down

0 comments on commit af9e775

Please sign in to comment.