-
Notifications
You must be signed in to change notification settings - Fork 85
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(numeral-date): update component to render as a fieldset element #7082
Conversation
LegendHelp is only used as a prop to render hint text with new validation, but does not render a help icon with tooltip if used with the legacy validation.
@@ -100,7 +98,7 @@ For more information check our [Validations](../?path=/docs/documentation-valida | |||
|
|||
This is an example of `Checkbox` in a `CheckboxGroup` with validations passed as a string. | |||
|
|||
**Note:** The `legendHelp` tooltip will be rendered as "Hint text". | |||
**Note:** The `legendHelp` will be rendered as "Hint 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.
The legendHelp
prop never rendered a tooltip and is only ever used to render the "Hint Text" within a fieldset with the new validation pattern. Updated the docs to reflect this.
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 spot! 👍🏼
required={required} | ||
/> | ||
</FormSpacingProvider> | ||
<StyledDateLabel |
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.
Comment: I wonder if this should be a label
element so that when a user clicks on it the relevant input is focused
)} | ||
|
||
<StyledNumeralDate onKeyDown={onKeyDown} data-component="numeral-date"> | ||
{dateFormat.map((datePart, index) => { |
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 (non-blocking): It looks like some of the composition here is the same as above, I wonder if it would be possible to store some of this in a variable and pass it to the relevant wrappers depending on the status of the validation flag.
const computedInputs = (...)
if (!validationRedesignOptIn) {
return (
<TooltipProvider helpAriaLabel={helpAriaLabel}>
<StyledFieldset
...
>
{computedInputs()}
</StyledFieldset>
</TooltipProvider>
)
}
return (
<StyledFieldset
...
>
{computedInputs()}
</StyledFieldset>
3668281
to
08ae2a0
Compare
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.
Great work on this @nuria1110 👍🏼
Reviewed this with a code look for semantic as well as testing voiceover in Safari, passing a11y review too. |
846ac88
to
261e89d
Compare
Adds `tooltipId` prop to provide an id for the legacy validation tooltip.
Updates NumeralDate component to render as a fieldset HTML element with a legend.
🎉 This PR is included in version 144.10.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Proposed behaviour
Updates NumeralDate's HTML to be rendered as a
<fieldset>
element.Current behaviour
NumeralDate is rendered as a number of input elements within
<div>
wrappers, which has no semantic meaning.Checklist
d.ts
file added or updated if requiredQA
Additional context
Testing instructions