-
Notifications
You must be signed in to change notification settings - Fork 83
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(textarea, textbox): ensure inputHint and labelHelp props do not render two seperate DOM elements #6363
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 0df5be9:
|
@@ -84,7 +80,7 @@ export interface TextareaProps | |||
label?: string; | |||
/** Inline label alignment */ | |||
labelAlign?: "left" | "right"; | |||
/** Text applied to label help tooltip */ | |||
/** [Legacy] Text applied to label help tooltip */ |
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.
suggestion: might be worth adding that if you have the redesign flag set and no inputHint prop this will be used etc
{...{ [validationType]: "Message" }} | ||
m={4} | ||
/> | ||
<Textarea | ||
label={`readOnly - ${validationType}`} | ||
inputHint="Hint text (optional)" |
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.
inputHint="Hint text (optional)" | |
inputHint="Hint text (optional)." |
😆
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.
Good stuff @tomdavies73, I think it would also be worth adding some tests that confirm the behaviour we're wanting when both props are set
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.
Nothing major to add to @edleeks87's comments 👍🏼
…ender two seperate DOM elements currently when consumers are opted into the new validation designs two seperate DOM elements are rendered which both act as hints for the input. This has been addressed by only rendering either the `inputHint` or `labelHelp` props in the same element, with `inputHint` taking priority
🎉 This PR is included in version 123.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Proposed behaviour
Currently, when consumers are opted into the new validation designs two separate DOM elements are rendered which both act as hints for the input. This has been addressed by only rendering either the
inputHint
orlabelHelp
props in the same element, withinputHint
taking priority.Current behaviour
Currently, when consumers are opted into the new validation designs two separate DOM elements are rendered which both act as hints for the input.
Checklist
d.ts
file added or updated if requiredQA
Additional context
Testing instructions
The following CodeSandbox is an example of the broken behaviour.
You can see the new behaviour by looking at the version in the comment by
codesandbox[bot]
.