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.

List renders only single item when rendered in an iframe

See original GitHub issue

Hi, I have a component where I render this

render() {
    return <Virtuoso
    totalCount={99}
    item={index => <div>Item {index}</div>}
    style={{ height: '400px', width: '100px' }}
  />
}

but only single one item is rendered

image image

anyone knows what could cause this?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
Alinocommented, Nov 11, 2020

I have cloned this repo to create unit test for this and fix it. After I looked at file Virutoso.test.tsx and I started doing this

test('render more than one item inside an iframe', () => {
  const render = renderer.create(
    <div>
      <Virtuoso totalCount={100} initialItemCount={20} item={() => <div />} />
    </div>
  )
  const items = (render.toJSON() as any).children[0].children[0].children[0].children
  expect(items).toHaveLength(20)
})

I found out that the items.length is 1 unless you add an initialItemCount And it also fixes my iframe issue.

0reactions
Alinocommented, Feb 27, 2021

I am closing this, as I think this (my original issue) is not relevant anymore since the big refactor.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I make an iframe capture ONLY one element of a ...
I'm trying to capture div#map-canvas from my site, www.RichBlocksPoorBlocks.com, to make an iframe that people can embed anywhere. Here's my ...
Read more >
The ultimate guide to iframes - LogRocket Blog
Not a fan of iframes? This post provides an overview of the tag's best features, shows you how to use them, and how...
Read more >
<iframe>: The Inline Frame element - HTML - MDN Web Docs
The <iframe> HTML element represents a nested browsing context, embedding another HTML page into the current one.
Read more >
Iframes with React: Best Practices | by Andrea Perera
render (<App />, document.getElementById("container"));. However, though it's easy to embed an Iframe into your React app, making it secure, fast ...
Read more >
An introduction to dynamic list rendering in Vue.js
This is in part due to using reusable web components. For example, we can see the list of tweets as a list of...
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