0

I am trying to render the svg icon based on the condition, whether aria-label is provided or not.

    return html`
      ${styles}
      <svg
        class="${className}"
        viewBox="${viewBox}"
        aria-hidden=${!ariaLabel}
        role="${ariaLabel ? 'img' : 'presentation'}"
        focusable="false"
      >
        ${content}
        ${ariaLabel ? html`<title>${ariaLabel}</title>` : nothing}

      </svg>
    `;

In my case the title is rendered as <title><?lit$515077604$></title>

and the real string value of ariaLabel is not inserted. Could you please explain me why?

badm
  • 219
  • 2
  • 13

0 Answers0