-
Notifications
You must be signed in to change notification settings - Fork 350
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
feat(textarea): support isDisabled #5107
Conversation
PF4 preview: https://patternfly-react-pr-5107.surge.sh |
@@ -10,11 +10,13 @@ export enum TextAreResizeOrientation { | |||
both = 'both' | |||
} | |||
|
|||
export interface TextAreaProps extends Omit<HTMLProps<HTMLTextAreaElement>, 'onChange' | 'ref'> { | |||
export interface TextAreaProps extends Omit<HTMLProps<HTMLTextAreaElement>, 'disabled' | 'onChange' | 'ref'> { |
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 in favor of this and I think it warrants finally having a "breaking type change" discussion I've been postponing.
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.
We should also add the isReadOnly
prop. That is what the consumer seems to be looking for. Please see my comment in the issue. We want the consumers to still be able to use the native disabled
or readOnly` attributes so we don't break them. Please add integration test to verify.
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.
Can you also update the demo app please.
@tlabaj done! 👍 |
Codecov Report
@@ Coverage Diff @@
## master #5107 +/- ##
=======================================
Coverage 52.40% 52.41%
=======================================
Files 541 541
Lines 9923 9925 +2
Branches 3696 3698 +2
=======================================
+ Hits 5200 5202 +2
Misses 4059 4059
Partials 664 664
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -124,6 +124,12 @@ export class TextAreaDemo extends React.Component<{}, TextAreaState> { | |||
validated={validated} | |||
aria-label="text area example 5" | |||
/> | |||
<Text>Disabled text area </Text> |
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.
can you update the cypress test to verify expected behaviour.
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.
this one just needs cypress tests updated.
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
Hi @tlabaj, I added tests to cypress as you requested. Sorry for the late response 🙇 |
Thank you all! |
What: Closes #5068
It is a breaking change. If someone is using
disabled
in the props then after updating with this change Typescript will show an error message sayingdisabled
is not a valid props ofTextArea
.