-
Notifications
You must be signed in to change notification settings - Fork 614
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
Cannot disable form inputs #759
Comments
hey @doitadrian i've seen the Input component, is it possible for missing prop types cause this? i think the implementation is already good |
@ahmad-reza619 what do you mean by |
@Pavel910 the Input component has no disabled prop types, but it use disabled prop, so I think it automatically remove props that doesn't specified in prop type. It's just my guess actually, I never used typescript before |
Actually that’s not correct, as you can see we compose types by importing the original Rmwc type and add our own props on top of that. Also, TS doesn’t remove anything, no tools do. You can’t remove a prop from component; whatever is passed to component will be in the props object at runtime. This is an interesting bug, I’ll take a look at it as well. |
Is it already fixed? |
@ahmad-reza619 nope, feel free to submit a PR if you'd like to take on this :) |
Alright will do, but wow, i never thought another component is the cause of all this 🤔 how is it even possible? is Bind forward it props to the children? |
This is:
Detailed Description
Passing a
disabled={true}
prop on components likeInput
andSelect
does not have any effect. For example:https://storybook.webiny.com/?path=/story/components-input--usage
https://storybook.webiny.com/?path=/story/components-select--usage
It works in the RMWC library - https://rmwc.io/text-fields.
Not sure where the bug is but if I hardcoded the
disabled={true}
inpackages/ui/src/Input/Input.tsx:112
, all inputs would become disabled as expected:So, it seems that the flag is not correctly passed to the actual RMWC
TextArea
component.The text was updated successfully, but these errors were encountered: