Open
Description
Describe the bug
Panel position is being reset to what is specified in the global options.
To Reproduce
Steps to reproduce the behavior:
- Run CRA example (note:
panelPosition: 'right'
is set in the options) - Open
/?path=/story/button--with-text
- Switch addons panel to the
bottom
mode - Open
/?path=/story/button--with-some-emoji
- Addons panel position is reset to the
right
mode
Expected behavior
Addons panel should be still displayed in the bottom.
Code snippets
Looks like the problem is here:
// lib/ui/src/core/context.js
api.on(STORY_CHANGED, id => {
const options = api.getParameters(id, 'options');
api.setOptions(options);
});
// lib/ui/src/core/layout.js
const updatedLayout = {
...layout,
...pick(options, Object.keys(layout)),
...checkDeprecatedLayoutOptions(options),
};
setOptions
is being called after every story change, and panelPosition
is being reset to what is specified in the options, as ...pick(options, Object.keys(layout)),
overrides whatever is in layout
.
System:
- OS: MacOS
- Device: Macbook Pro 2015
- Browser: chrome
- Framework: react
- Version: 5.1.0-alpha.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment