vaheqelyan / svelte-grid

A responsive, draggable and resizable grid layout, for Svelte. [NOT MAINTAINED]
https://svelte-grid.now.sh/
MIT License
970 stars 58 forks source link

Demo code doesn't show anything until window is resized #67

Closed natemartinsf closed 3 years ago

natemartinsf commented 3 years ago

I'm sure I'm something stupid here, so I apologize in advance.

I'm trying to get the "basic example" to work in my project, but it's just rendering a blank screen until I resize the screen

Steps to reproduce: 1) Create a new Svelte project as described here using degit: https://svelte.dev/blog/the-easiest-way-to-get-started 2) Install svelte-grid 3) Replace App.svelte with the content of the "basic example" and start server 4) Nothing shows up 5) Resize the window, and the demo looks as expected.

vaheqelyan commented 3 years ago

similar to https://github.com/vaheqelyan/svelte-grid/issues/55. you just need to create a container. my fault, the examples do not include this

<style>
  .container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
</style>

<div class=container>
  <Grid bind:items={items} rowHeight={100} let:dataItem {cols}>
    <div class=content>{dataItem.id}</div>
  </Grid>
</div>
vaheqelyan commented 3 years ago

I'll update them all soon.

vaheqelyan commented 3 years ago

feel free to reopen