ThatOpen / engine_ui-components

Collection of web components meant to be used, but not limited to, BIM applications.
MIT License
9 stars 12 forks source link

GRID: When switching to a layout with more rows, the bottom rows are not displayed #28

Open K1vs opened 1 month ago

K1vs commented 1 month ago

Describe the bug 📝

I have created a Grid like in the example (https://thatopen.github.io/engine_ui-components/examples/Grid/) where there are 2 layouts. One with two row, the other with three. Switching from a three-row to a two-row layout takes place without any problems. But when switching from two-row to three-row , the bottom row is not displayed. Since the original example works, I understood why - because there is a phase with an undefined layout. Based on this I found a workaround:

    if(layout === "three-row"){
      this._grid.layout = undefined;
      setTimeout(() => {
        this._grid.layout = layout;
      }, 100);
    } else {
      this._grid.layout = layout;
    }

But it has side effects and needs to have a real fix.

Reproduction ▶️

No response

Steps to reproduce 🔢

  1. Create Grid
  2. Add layout with 2-row template
  3. Add layout with 3-row template
  4. Set 2-row as initial
  5. Add button to change layout to 3-row
  6. Run app
  7. Click layout switch button
  8. See on screen - 3-rd row does not apear

System Info 💻

System:
    OS: Windows 11 10.0.22631
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700K
    Memory: 18.51 GB / 31.79 GB
  Binaries:
    Node: 20.10.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.5 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.5.1 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Edge: Chromium (126.0.2592.81)
    Internet Explorer: 11.0.22621.3527

Used Package Manager 📦

npm

Error Trace/Logs 📃

No response

Validations ✅

HoyosJuan commented 1 month ago

Hey @K1vs!

May you please tell me the layout templates used? So I can test with your same example.

HoyosJuan commented 1 month ago

Hey @K1vs! Any updates on this?