Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Initial state" controls empty even when prop values for the component got defined #188

Closed
6 tasks done
awacode21 opened this issue Jul 20, 2022 · 7 comments
Closed
6 tasks done
Labels
to triage This issue needs to be triaged

Comments

@awacode21
Copy link

Describe the bug

The initial state controls of a component are always empty, even though there got prop values defined for a component.
It doesn't matter if i set every single prop on its own for a component or if i use v-bind with an object containing the props. in each case the initial state controls are empty.

On reproduction with the button example the button gets the initial state to be red with count 2. But the controls are empty. I would expect that the controls get the values which are defined for the component.

Bildschirmfoto 2022-07-20 um 11 31 23

Bildschirmfoto 2022-07-20 um 11 32 31

Reproduction

https://stackblitz.com/edit/histoire-vue3-empty-controls-on-initial-state?file=src%2FBaseButton.story.vue

System Info

System:
    OS: macOS 12.1
    CPU: (8) x64 Apple M1
    Memory: 23.70 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
  Browsers:
    Chrome: 103.0.5060.114
    Firefox: 102.0.1
    Safari: 15.2
  npmPackages:
    @vitejs/plugin-vue: ^2.3.3 => 2.3.3
    histoire: ^0.7.9 => 0.7.9
    vite: ^2.9.13 => 2.9.13

Used Package Manager

npm

Validations

@awacode21 awacode21 added the to triage This issue needs to be triaged label Jul 20, 2022
@awacode21
Copy link
Author

Might be related somehow to: #164

@Akryum
Copy link
Member

Akryum commented Jul 20, 2022

Looks like it's working for me:
image

Maybe you mean the Auto Props Controls which are just overrides so they are inactive by default.

@Akryum Akryum closed this as not planned Won't fix, can't repro, duplicate, stale Jul 20, 2022
@awacode21
Copy link
Author

But then i don't understand the auto props controls. What are they useful for?

@Akryum
Copy link
Member

Akryum commented Jul 20, 2022

They allow you to override any prop value even if there are no controls authored for it.

@awacode21
Copy link
Author

so you always need to define your own controls to reflect props initial state? sounds like auto props are useless. Because if you nevertheless need to define your own controls to reflect with initial state then you have always double controls which do the same. This confuses me a bit and i think also the "reader" because he don't know which of the controls to use. Is there a config option to switch off the auto props display?

@Akryum
Copy link
Member

Akryum commented Jul 20, 2022

We could display the default values of props in the auto props controls, but that's separate from your original issue. Maybe you can open a feature request?

Is there a config option to switch off the auto props display?

https://histoire.dev/reference/vue3/story.html#autopropsdisabled

@awacode21
Copy link
Author

We could display the default values of props in the auto props controls, but that's separate from your original issue. Maybe you can open a feature request?

Is there a config option to switch off the auto props display?

https://histoire.dev/reference/vue3/story.html#autopropsdisabled

thank you very much for clarification and the docs link.
i will open a feature request for displaying default values of props in the auto props controls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants