Skip to content

Commit

Permalink
Image error overlay fixes (#3256)
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot authored Feb 27, 2024
1 parent f2b0ec1 commit f0478cf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/toolpad-components/src/components/ErrorOverlay.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SxProps, Typography, styled } from '@mui/material';
import { SxProps, Typography, styled, Tooltip } from '@mui/material';
import * as React from 'react';
import { errorFrom } from '@mui/toolpad-utils/errors';
import ErrorIcon from '@mui/icons-material/Error';
Expand All @@ -9,6 +9,9 @@ const OverlayRoot = styled('div')(({ theme }) => ({
alignItems: 'center',
justifyContent: 'center',
padding: theme.spacing(2),
maxWidth: '100%',
maxHeight: '100%',
overflow: 'hidden',
}));

interface ErrorContentProps {
Expand All @@ -24,7 +27,11 @@ export function ErrorContent({ sx, error }: ErrorContentProps) {
<ErrorIcon fontSize="small" color="error" />
Error
</Typography>
<Typography variant="body2">{errMessage}</Typography>
<Tooltip title={errMessage}>
<Typography variant="body2" align="center">
{errMessage}
</Typography>
</Tooltip>
</OverlayRoot>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,12 @@ spec:
props:
mode: switch
label: Switch
- component: Image
name: image1
props:
width: 100
height: 100
src:
$$jsExpression: veryLongIdentifierThatResultsInLongErrorMessage.nonExisting
alias:
- f703ps3

0 comments on commit f0478cf

Please sign in to comment.