Sorting is only working for high level items, not for stories. Tried used the provided option sortStoriesByKind
storiesOf('1. Fields', module)
.add('2. item2', () => </>);
storiesOf('1. Fields', module)
.add('1. item1', () => </>);
storiesOf('1. Fields', module)
.add('3. item3', () => </>);
storiesOf('2. Layout', module)
.add('3. item3', () => </>);
setOptions({
sortStoriesByKind: true,
});
will only order 1. Fields 2. Layout but inside 1. Fields items will not be sorted
All items need to be sorted
something like this can be done
function sort(stories, sortStoriesByKind) {
if (!sortStoriesByKind) return stories;
stories = stories.map((item) => {
item.stories = sortBy(item.stories);
}
return sortBy(stories, ['kind']);
}
and problem will be solved. what do you think? I could create PR if needed :D
I edited your multiline codeblocks to use triple backticks for readability purposes.
@dioxmio, sounds legit, wanna PR?
Not sure if it's breaking change or not though...
sure, I will try to create the PR this week @igor-dv :D
@dioxmio bump pretty please :)
can reproduce, things get messy without sorting
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
This is still an issue!
I am working on this PR to fix this issue
https://github.com/storybooks/storybook/pull/3963
PR was merged to master. Closing this issue then
Most helpful comment
sure, I will try to create the PR this week @igor-dv :D