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.

Positioning styles passed to component no longer work

See original GitHub issue

Hi!

We used to call the component setting position: sticky like this, to make the cookie banner “sticky”:

<CookieConsent style={{ position: 'sticky' }}>
  Cookie text!
</CookieConsent>

But now that the component has a wrapping div, this style is set on the inner div instead, and the positioning doesn’t work.

Is there a new configuration we should be looking at to make this work like it used to? Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Mastermindzhcommented, Jun 29, 2020

Cool, not great with css myself. Glad it fixed it!

0reactions
kimroencommented, Jun 29, 2020

@Mastermindzh Thanks, this now works as expected! ✨

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enable CSS position style overrides (Can't use absolute ...
The map element always has relative positioning set using the width and height properties of the component.
Read more >
TS error using css "position" when passing style object to ...
It's because you are using plan object value as css prop value for emotion directly. Only direct input of css style object into...
Read more >
position - CSS: Cascading Style Sheets - MDN Web Docs
The position CSS property sets how an element is positioned in a document ... The offset does not affect the position of any...
Read more >
Self Positioning React Components - freeCodeCamp
If you look in componentWillRecieveProps , setStyles and getStyles you'll see reference to how the component is removed and added with display ...
Read more >
Absolute, Relative, Fixed Positioning: How Do They Differ?
I am fairly new to web design, and haven't mastered the differences in positioning of elements. I know there is absolute , fixed...
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