Tabs ยท console.warn
tabs: a tab configured with `badge` has never been activated, so it has no grid to count and shows no badge until it is. Pass `config.createHeadlessGrid` - e.g. `import { createHeadlessGrid } from 'lattice-grid'` - to give every tab a live count from first paint.
Printed by Tabs, prefixed [lattice], since 1.59.0.
Warnings reference › tabs.badge.headless
- Identifier
tabs.badge.headless- Raised by
- Tabs
- Since
- 1.59.0
What happened
Counting a tab that has not been opened needs a headless grid, and the strip was not given the factory for one. Every unopened tab with badge: true therefore shows nothing until the user clicks it, at which point the badge appears - which reads as a bug rather than as a missing option, so it is named once.
The fix
Pass createHeadlessGrid alongside createGrid when you create the strip.
The smallest fix
import { createGrid, createHeadlessGrid } from '@toclocoinc/lattice-grid';
createTabs(el, { createGrid, createHeadlessGrid, tabs });
Reference
Covered in full at the API reference.