svg icon does not display - rendered size is zero

Created on 5 June 2024, 11 months ago

On /node/add - some svg type tray icons display ok and the browser inspector tells me rendered size is 36 x 36px but at least one does not display and inspector tells me rendered size of the icon is 0 x 0px - the svg path is fine and loads correctly ie example.com/themes/mytheme/images/type-tray/myicon.svg

💬 Support request
Status

Active

Version

1.2

Component

Miscellaneous

Created by

🇬🇧United Kingdom juc1

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @juc1
  • 🇬🇧United Kingdom juc1

    I think the problem occurs because for me on a desktop the content type description on /node/add only allows about 24 characters per line so if your content type description contains a word or link over 24 characters then it seems that the type tray icon gets squeezed out and rendered as zero pixels.

  • 🇨🇦Canada deviantintegral

    Good sleuthing! This sounds like a bug to me.

  • 🇬🇧United Kingdom juc1

    Just looking at this again - for some browser widths, my .png icon does not render, and the browser inspector says for the .png icon "rendered size 0 x 0px".

    I can fix this in inspector by adding a width to .type-tray__icon

    <div class="type-tray__icon">
              <img width="36" height="36" alt="Icon of a Article content type." src="/sites/default/files/images/icons/newspaper.png">
          </div>
    
  • 🇬🇧United Kingdom juc1
Production build 0.71.5 2024