question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Non-prop attributes are not being inherited

See original GitHub issue

When transforming an svg to a component and trying to add an attribute, like `data-testid, and it’s not being rendered

Example:

<template>
  <div id="app">
    <Icon style="flex: 1" class="icon" data-testid="asfg"/>
  </div>
</template>

<script setup>
import Icon from './icons/icon.svg';
</script>

Render as:

<div id="app">
  <svg class="icon" viewBox="0 0 360 264" fill="none" xmlns="http://www.w3.org/2000/svg" style="flex: 1 1 0%;">
    ...
  </svg>
</div>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
visionm45commented, Sep 20, 2021

I also need the attributes to remain intact. Otherwise i cannot use this

0reactions
Antticommented, Nov 3, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue JS Non prop attributes and Disabling Attribute Inheritance
If you put a random html attribute onto the component, it will appear on the rendered component. If you disable inheritance, it won't....
Read more >
Non-Prop Attributes - Vue.js
Attribute Inheritance. When a component returns a single root node, non-prop attributes will automatically be added to the root node's ...
Read more >
Fallthrough Attributes - Vue.js
Attribute Inheritance #. A "fallthrough attribute" is an attribute or v-on event listener that is passed to a component, but is not explicitly...
Read more >
31. Non Prop Attributes and Attribute Inheritance. Disable ...
Hi FriendsIn this video, we will see the non-prop attributes and how to access them using $attrs variable in child component.
Read more >
Inheritance Within the Object Type Hierarchy - Salesforce Help
Vlocity object types are designed with an inheritance type architecture where ... You should not delete the inherited attributes and fields from the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found