diff --git a/newIDE/app/src/ResourcesList/CompactResourceSelectorWithThumbnail/index.js b/newIDE/app/src/ResourcesList/CompactResourceSelectorWithThumbnail/index.js
index 7abd8c12de98..5a276714eadd 100644
--- a/newIDE/app/src/ResourcesList/CompactResourceSelectorWithThumbnail/index.js
+++ b/newIDE/app/src/ResourcesList/CompactResourceSelectorWithThumbnail/index.js
@@ -245,7 +245,11 @@ export const CompactResourceSelectorWithThumbnail = ({
[classes.compactResourceSelector]: true,
})}
>
-
+ onChange(e.currentTarget.value)}
+ />
{
const { onContextMenu, resourcesLoader, resourceName, project } = props;
const theme = React.useContext(GDevelopThemeContext);
+ const [error, setError] = React.useState(false);
// Allow a long press to show the context menu
const longTouchForContextMenuProps = useLongTouch(
@@ -60,6 +61,8 @@ const ImageThumbnail = (props: Props) => {
const normalBorderColor = theme.imagePreview.borderColor;
const borderColor = props.selected
? theme.palette.secondary
+ : !!error
+ ? theme.message.error
: normalBorderColor;
const containerStyle = {
@@ -87,9 +90,16 @@ const ImageThumbnail = (props: Props) => {
...styles.spriteThumbnailImage,
maxWidth: props.size || 100,
maxHeight: props.size || 100,
+ display: error ? 'none' : undefined,
}}
alt={resourceName}
src={resourcesLoader.getResourceFullUrl(project, resourceName, {})}
+ onError={error => {
+ setError(error);
+ }}
+ onLoad={() => {
+ setError(false);
+ }}
/>
{props.selectable && (