-
Notifications
You must be signed in to change notification settings - Fork 86
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
fix: add controlled prop #1140
fix: add controlled prop #1140
Conversation
Your Render PR Server URL is https://telekom-scale-storybook-preview-pr-1140.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-cb8lbus41lsd7r62d640. |
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.
Also, should we also document this new controlled
prop in Storybook? I think yes, but with a notice saying it's "experimental"… maybe?
@@ -96,6 +96,8 @@ export class TextField { | |||
/** (optional) Injected CSS styles */ | |||
@Prop() styles?: string; | |||
|
|||
/** (optional) Makes type `input` behave as a controlled component in React */ | |||
@Prop() controlled?: boolean = false; |
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.
I'm thinking whether we should prefix this with "experimental", what do you think? 🤔
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 i replaced (optional) with (experimental) but I'm not sure if that is what you meant or to change the prop name to something like experimental_controlled
? Wasn't sure because in other components like the dropdown there is also a controlled
prop but without any experimental prefix
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.
yes, haha, I was thinking about experimental_controlled
— the old Dropdown is going to be deprecated.
Would it work with the snake_case? 🤔
@@ -96,6 +96,8 @@ export class TextField { | |||
/** (optional) Injected CSS styles */ | |||
@Prop() styles?: string; | |||
|
|||
/** (optional) Makes type `input` behave as a controlled component in React */ | |||
@Prop() controlled?: boolean = false; |
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.
yes, haha, I was thinking about experimental_controlled
— the old Dropdown is going to be deprecated.
Would it work with the snake_case? 🤔
I got confused with the many "conversations" I opened in the comments, haha, sorry 🙏 |
@acstll all CI jobs are passing now, snake_case doesn't work so i changed it to experimental-controlled. I also added the prop to storybook, but there is no real documentation on why/how someone would use it. Should that be included in storybook as well? or maybe just in the readme? |
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 using the same approach as in the dropdown fixes this react/reactivity issue, I guess this would need to be added to some other components as well to avoid the same issue in the future (at least in text-area).