vitmalina / w2ui

UI widgets for modern apps. Data table, forms, toolbars, sidebar, tabs, tooltips, popups. All under 120kb (gzipped).
http://w2ui.com
MIT License
2.67k stars 727 forks source link

Grid height 100% and resize #2561

Open dirkk0 opened 2 months ago

dirkk0 commented 2 months ago

Short description Setting the height of the main div to '100%'; or omit

What is current behavior If you take the sidebar and grid example, the grid's height is set to a fixed value. If I set the main div to '100%', the grid vanishes.

What is desired behavior The grid should adapt to a 100% div.

A possible workaround is to set the grid height with javascript:

window.onresize = onResize

function onResize() {
  let h = window.innerHeight
  h = h + "px"
  main.style.height = h 
}
onResize()

but that seems unnecessarily complicated to me. If for some reason this is not a bug but a desired behaviour, it should be mentioned in the docs.