Controls: Allow story argTypes to override control: false from meta#33729
Merged
valentinpalkovic merged 1 commit intostorybookjs:nextfrom Feb 3, 2026
Merged
Conversation
Fixes storybookjs#27091 When meta defines `argTypes: { prop: { control: false } }`, story-level argTypes with `control: 'text'` or `control: { type: 'select' }` should be able to re-enable the control. The issue was that `control: false` was normalized to `{ disable: true }` and `control: 'text'` was normalized to `{ type: 'text' }`. When merged via combineParameters, both properties were kept, resulting in `{ disable: true, type: 'text' }` which still disabled the control. The fix ensures that when a control type is explicitly specified, the normalized control object includes `disable: false` to override any inherited `disable: true` from parent argTypes. This maintains backward compatibility: - `control: false` still disables controls - `control: { disable: true }` still works - But now `control: 'text'` properly overrides `control: false`
Contributor
📝 WalkthroughWalkthroughThe normalizeInputTypes module is enhanced to set Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
valentinpalkovic
approved these changes
Feb 3, 2026
8 tasks
Merged
1 task
This was referenced Mar 18, 2026
Merged
1 task
This was referenced Mar 18, 2026
This was referenced Mar 18, 2026
1 task
This was referenced Mar 18, 2026
1 task
This was referenced Mar 31, 2026
1 task
This was referenced Apr 2, 2026
1 task
This was referenced Apr 5, 2026
1 task
This was referenced Apr 6, 2026
1 task
4 tasks
1 task
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #27091
When meta defines
argTypes: { prop: { control: false } }, story-level argTypes withcontrol: 'text'orcontrol: { type: 'select' }should be able to re-enable the control.Problem
The issue was that:
control: falsewas normalized to{ disable: true }control: 'text'was normalized to{ type: 'text' }combineParameters, both properties were kept, resulting in{ disable: true, type: 'text' }disable: trueproperty meant the control stayed disabledSolution
When a control type is explicitly specified in
normalizeControl(), the normalized control object now includesdisable: falseto override any inheriteddisable: truefrom parent argTypes.Changes
normalizeControl()innormalizeInputTypes.tsto setdisable: falsewhen a type is specifiedBackward Compatibility
control: falsestill disables controls ✅control: { disable: true }still works ✅control: { type: 'text', disable: true }still keeps control disabled ✅control: 'text'properly overridescontrol: false✅Example
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.