laravel / nova-issues

554 stars 35 forks source link

Null image field results in confused list view UI #4856

Closed Synchro closed 1 year ago

Synchro commented 1 year ago

Description:

If an image field is nullable and is null, in a detail view it shows as a long dash. The same image shown in an index view shows a long dash and an error icon:

Screenshot 2022-09-29 at 11 19 20

Rolling over the icon displays an error message "The image could not be loaded".

Screenshot 2022-09-29 at 11 19 29

I'm not expecting the image to be loaded because the field is null, so this seems like a bug.

In this case my image field is declared like this:

            Image::make('Decom Image')
                ->disk('decom')
                ->nullable()
                ->maxWidth(120),

I think the error icon and message should only appear if the field is not null and the image it holds cannot be found. Otherwise it should just display the dash, as it does in the detail view. If the image field is not null and is missing, only the error icon should be shown, not the dash as well.

github-actions[bot] commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.