-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Removed lowercase-only restriction for knobs #2646
Conversation
Take in account that now the knob name needs to be the same as the angular component @input attribute. Otherwise it'll not bind to the correct property. Signed-off-by: Carlos Vega <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #2646 +/- ##
==========================================
+ Coverage 34.06% 34.34% +0.27%
==========================================
Files 383 389 +6
Lines 8710 8750 +40
Branches 897 911 +14
==========================================
+ Hits 2967 3005 +38
- Misses 5148 5150 +2
Partials 595 595
Continue to review full report at Codecov.
|
Take in account that now the knob name needs to be the same as the angular component @input attribute. Otherwise it'll not bind to the correct property. Signed-off-by: Carlos Vega <[email protected]>
…ybook into camelcased-angular-knobs
@@ -73,11 +73,10 @@ const getAnnotatedComponent = ({ componentMeta, component, params, knobStore, ch | |||
const oldValue = knobOptions.value; | |||
knobOptions.value = value; | |||
knobStore.markAllUnused(); | |||
const lowercasedName = name.toLocaleLowerCase(); | |||
this[lowercasedName] = value; | |||
this[name] = value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So as I understand we can't give a different name to knobs? It has to be a name of the prop, right? Or maybe all knobs are working the same way and I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. The knobs work a bit different in the other frameworks because in those you can just send the value in as a prop. With Angular we need to bind to an specific field and check for the changes. That's why, in this specific case, to preserve the same api the name of the knob needs to be equal to the field name.
Removed lowercase-only restriction for knobs
Take in account that now the knob name needs to be the same as the angular component @input attribute. Otherwise it'll not bind to the correct property.
Issue: #2641
What I did
Removed lowercase-only restriction for knobs
How to test