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.

[v2] Pass down data attributes to container/nested elements

See original GitHub issue
  • What’s your use case?

I want easily select react-select using data-testid attribute selector for e2e test using cypress

  • What interface do you have in mind?

Please pass down data attributes to the, at least, container, or come up with more advanced API for such use cases for easy selection of internal elements using CSS selectors.

So we can easily type, click etc. Some additions to the docs “how to test” will be a nice thing to have too.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:24
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

13reactions
IanVScommented, Apr 6, 2019

@gwyneplaine it definitely would be nice to have a way to use data- attributes rather than class names, as recommended in the cypress docs.

3reactions
RIP21commented, Nov 15, 2018

Is this project dead? 😃 I understand that there is hundreds of Issues and PRs etc. But, dunno, maybe it’s time to give control over this project to some fellow OSS contributors that will be happy to review and clean up the mess at least a little bit? 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to properly pass custom data attribute props to child ...
Dashes are not allowed in variable names. So, you have to use quotes ''. const Example = (props) => <div>{props['data-name']}</div> ReactDOM.render( ...
Read more >
Using data attributes - Learn web development | MDN
This article is adapted from Using data attributes in JavaScript and CSS on hacks.mozilla.org. Custom attributes are also supported in SVG 2; ...
Read more >
A Complete Guide to Data Attributes | CSS-Tricks
Everything you ever wanted to know about data attributes in HTML, CSS, and JavaScript.
Read more >
How to Access Custom Attributes from Event Object in React
Adding a custom attribute to an element is a great way to pass in additional data as meta properties. They can be accessed...
Read more >
Enhance Your Lightning Web Components with Data Attributes
Data attributes give you the ability to specify custom attributes on any elements with the HTML of your Lightning Web Component.
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