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.

Initial inline styles prevent timeline from rendering properly when not initially visible.

See original GitHub issue

So, here is my use case: I’m using react-router, and have several pages. On the first page, no timeline is being rendered. I switch to the second page where a timeline should be rendered, but it is not visible. I can inspect it, and see that the element is there, but it has an inline style on the .vis-timeline element which sets it to hidden.

I can change the visibility using css or in code, but then it’s only visible and you cannot scroll or use the timeline.

The solution I found was to get the timeline in my componentDidMount function, and then set the styles on .vis-timeline to an empty string. For example:

componentDidMount() {
    let timeline = document
      .getElementById("uniqueId")
      .getElementsByClassName('vis-timeline')[0];
    timeline.style = "";
  }

This was the only way I could get it to initialize correctly. This may be related to #38 as well.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:3
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
jwarykowskicommented, Mar 13, 2018

@daumann - Sorry for the delay on this. We’ve super busy the last few months and have dropped the ball on this one. We’ll try and have a quick look tomorrow! 👍

1reaction
willmcclellancommented, Apr 10, 2018

Is there a really simple example someone can build to reproduce this, without having to pull in react-router?

Read more comments on GitHub >

github_iconTop Results From Across the Web

visibility - CSS: Cascading Style Sheets - MDN Web Docs
The visibility CSS property shows or hides an element without changing the layout of a document. The property can also hide rows or...
Read more >
Improve site performance by inlining your CSS - LogRocket Blog
As one developer's benchmark indicates, inline-styling every HTML element significantly affects the time to first contentful paint.
Read more >
Should CSS always precede JavaScript? - Stack Overflow
While it makes sense to block all rendering for stylesheets (so you get the correct styling the first time and avoid the flash...
Read more >
How to Load Fonts in a Way That Fights FOUT and Makes ...
That means using bare minimum presentation styles (i.e. inlined critical CSS) in the loading process. That is also why web fonts are considered ......
Read more >
Optimize CSS Delivery | PageSpeed Insights
Before the browser can render content it must process all the style and layout information for the current page. As a result, 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