Open jtdLab opened 1 month ago
Hello @jtdLab 👋
Thanks for reporting this issue!
I was able to reproduce it on my side, and it turns out that it's caused by the commas.
It happened before with string
knobs and was fixed in #817.
As a quick workaround for now, you can change how the knob's value is encoded/decoded as follows. Unfortunately this will affect the label of the dropdown as well.
final favoriteFinishes = context.knobs.list(
label: 'Favorite Finishes',
labelBuilder: (value) => value.join('-'),
initialOption: const [16, 32, 40],
options: [
const <int>[],
const [16],
const [16, 32],
const [16, 32, 40],
],
);
The proper fix would be to use URL encoding/decoding for knobs' values (similar to what we did with knobs' labels in #1165). This will help prevent the issue from happening with other knobs as well.
Would you like to contribute to Widgetbook by submitting a PR for that fix?
Hi @YoussefRaafatNasry
I will like to work on this issue.
Great, @yunweneric! Looking forward for the PR 👀
Awesome 😎
Description Can not select knob list options with 2 items.
Steps To Reproduce
1.
Expected Behavior Select it and update the widget.
Additional Context With 0,1 and 3 items it works
Error Logs: