Skip to content

Troubleshooting

Confirm that the stylesheet is imported and the grid host has a resolved height.

main.tsx
import 'mosyn/style.css';
dashboard.css
.dashboard-host {
display: flex;
min-height: 0;
height: 100vh;
}

See Getting started for the complete height chain.

A tile resets after another component renders

Section titled “A tile resets after another component renders”

Keep the tiles array reference stable. Define static tiles outside the component or memoize derived tiles.

Dashboard.tsx
const tiles = useMemo(() => createTiles(), []);
return <Mosyn tiles={tiles} />;

Do not construct a new array inline on every render.

Add their selectors to DragCancel.

Dashboard.tsx
<Mosyn tiles={tiles} DragCancel={['button', 'input', 'select', '.no-drag']} />

Confirm all three parts of the container pattern:

  1. The parent tile uses isContainer: true.
  2. The parent tile has children.
  3. Its renderer returns <Mosyn tiles={tile.children ?? []} container={tile} />.

Read Nested grids for the complete example.

The hook must be rendered below MosynManager. It can also be temporarily unavailable before the requested grid has mounted, so handle a missing value when reading a nested grid.

Select a tile first. Mosyn reveals resize handles for the selected tile. Use a current browser with CSS :has() support; the handle visibility rule depends on it.