directus icon indicating copy to clipboard operation
directus copied to clipboard

SVG thumbnails in display templates are not scaled down to fit the display in details view

Open louiscoste opened this issue 9 months ago • 6 comments

Describe the Bug

When setting the display template to contain the thumbnail of an image and the image is a large SVG file, the thumbnail fails to scale it down to fit the line height and the image shows up on top of the fields and you cannot click behind the image. The user is forced to use keyboard navigation to edit the fields

Screenshot: Image

To Reproduce

  • Create a collection with an image and some other fields such as title
  • Set the display template of that collection to be the image thumbnail followed by the title
  • Create an item in that collection with a large SVG for the image
  • Open the details view for that object
  • The thumbnail image from the title line shows up large and overlaps fields that I need to edit

Directus Version

v11.14.0

Hosting Strategy

Self-Hosted (Docker Image)

Database

PostgreSQL 16

louiscoste avatar Feb 23 '26 16:02 louiscoste

CMS-1882

linear[bot] avatar Feb 23 '26 16:02 linear[bot]

I do not know how to best provide the sample image I use for testing this. Hopefully I can attach it here

Image

louiscoste avatar Feb 23 '26 16:02 louiscoste

Hi @AlexGaillard , can I take up this issue?

Tsaishashanth avatar Feb 23 '26 19:02 Tsaishashanth

@Tsaishashanth Yeah sure 😄 Please do

AlexGaillard avatar Feb 23 '26 19:02 AlexGaillard

@Tsaishashanth Sorry, didn't realize this was fixed elsewhere 🫠

AlexGaillard avatar Feb 26 '26 19:02 AlexGaillard

@AlexGaillard No worries,it took me some time to get it running locally too. I’ll try to contribute to other issues.

Tsaishashanth avatar Feb 26 '26 20:02 Tsaishashanth