histoire
histoire copied to clipboard
Grid layout with 100% width shows only 10 variants
Describe the bug
In grid layout with 100% width the maximum amount of variants is not updating/showing correctly and the story only shows first 10 variants. Resizing the window sometimes helps and update/show more variants.
Reproduction
I took the histoire-vue3-starter, updated histoire and @histoire/plugin-vue to latest version 0.12.4 and created a simple MaximumVariant story with 15 variants. https://stackblitz.com/edit/histoire-vue3-starter-ntbrzs?file=src/MaximumVariant.story.vue. Scrolling down only shows 10 variants.
System Info
System:
OS: Windows 10 10.0.19042
CPU: (8) x64 Intel(R) Core(TM) i5-10310U CPU @ 1.70GHz
Memory: 2.92 GB / 15.61 GB
Binaries:
Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
npm: 7.20.5 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.19041.423.0), Chromium (108.0.1462.54)
npmPackages:
@histoire/plugin-vue: ^0.12.4 => 0.12.4
@vitejs/plugin-vue: ^4.0.0 => 4.0.0
histoire: ^0.12.4 => 0.12.4
Used Package Manager
pnpm
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- [X] The provided reproduction is a minimal reproducible example of the bug.
+1 have the same issue on the latest release, also occurs with smaller layout widths depending on window/screen size
:layout="{ type: 'grid', width: 200 }"
I am running into this issue too. My guess it is coming from this line here (the limit=10): https://github.com/histoire-dev/histoire/blob/7a4dfd3d5d1552cf15309359232362919bc4d7d5/packages/histoire-plugin-vue/src/util/list-components.ts#L3
I tried to pull the package down to test the theory but kept running into TS issues and I don't have time right now to figure all that out. I will try to come back later but I think this should be an easy fix.
I may be way off base though.