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.

JSS Cannot target child to perform some basic css operations

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

One should be able to create something like: List item has a child which is hidden by default. When the List item gets hovered, the child gets displayed. screen shot 2018-04-17 at 10 52 05

from here: http://cssinjs.org/jss-nested/?v=v6.0.1#use-rulename-to-reference-a-local-rule-within-the-same-style-sheet

The component in question is this: <ListItemSecondaryAction className={classes.actionsContainer}>

Current Behavior

Trying to change a style of a child on parent hover. It doesn’t seem to work. I might as well be using it wrong though…

Should I do something to enable this behavior? As I understood the documentation the jss-nested should already be available?

Your Environment

Tech Version
Material-UI 1.0.0-beta.41
React 16.3.0
browser
etc

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
mnemanjacommented, Apr 18, 2018

@oliviertassinari I understand, no problem.

By the way, the problem was that the <ListItem> classes added with className actually get applied to the element that gets generated under the <li> item, but not the <li> itself. For that I’ve used ContainerProps={{ className: classes.listItem }} and declared the hover under the listItems style.

Sorry for taking your time for this trivial problem. I hope this might help someone else who encounters the same problem.

Cheers 😉

1reaction
HebaruSancommented, Jun 7, 2018

@mnemanja, your solution worked for me and saved me many hours and much frustration! Thank you for sharing!

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSS Cannot target child to perform some basic css operations
Basically, it works when I hover the checkboxItem , but not the actionsContainer . I'm not sure how to debug if the code...
Read more >
How to apply style to parent if it has child with CSS?
We know how to apply styles to the child elements if a parent class has one. But if we want to apply a...
Read more >
How do I prevent drag on a child, but allow drag on the parent?
If you want to truly cancel out the drag and make it unnoticeable to parent drag handlers, you need to both preventDefault and...
Read more >
touch-action - CSS: Cascading Style Sheets - MDN Web Docs
The touch-action CSS property sets how an element's region can be manipulated by a touchscreen user (for example, by zooming features built ...
Read more >
Overriding CSS properties of third-party components in Angular
However, the element that you want to target using the CSS selector is not a child, but just a descendant of the cars-page...
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