Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image error overlay fixes #3256

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading