Closed esbenjuul closed 3 years ago
Hi @ esbenjuul
Can you provide example (js code), so it issue will be more clear for me?
Maybe what's meant here is the same issue that i have. I want to use this addon to allow users of a Storybook to switch LTR/RTL direction (dir
attribute). It is also necessary to have the dir
attribute to be set to ltr
by default.
So it makes sense to configure the addon like this:
rootAttribute: {
defaultState: {
name: 'LTR',
value: 'ltr'
},
attribute: 'dir',
states: [
{
name: 'LTR',
value: 'ltr'
},
{
name: 'RTL',
value: 'rtl'
}
]
}
with one of the selectable states being the default one, therefore having the same name and value. But in this case we indeed get a message in the panel ERROR: Found non unique name values
.
Is this something that could be resolved?
@certainlyakey Just remove duplication from state
, because defaultState
also part of state:
rootAttribute: {
defaultState: {
name: 'LTR',
value: 'ltr'
},
attribute: 'dir',
states: [
{
name: 'RTL',
value: 'rtl'
}
]
}
Thanks, it worked! 😊
Hi First of all thanks for the addon. I tried to overwrite the default state on my story but unless I select a whole new state i get the error 'ERROR: Found non unique name values'. Would be cool if it was possible to select one of the already defined states on my stories. I can try to do a PR if you like.
Best Esben