Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

[date-time-picker]Fix for space and label issues #1969

Closed
wants to merge 19 commits into from

Conversation

ashishkumbhare116
Copy link
Contributor

@ashishkumbhare116 ashishkumbhare116 commented Jan 8, 2024

Summary

Fix the spacing between datetimepicker and help/error text and label announcement in screen readers

What was changed:

Why it was changed:

Testing

This change was tested using:

  • WDIO
  • Jest
  • Visual testing (please attach a screenshot or recording)
  • Other (please describe below)
  • No tests are needed

Reviews

In addition to engineering reviews, this PR needs:

  • UX review
  • Accessibility review
  • Functional review

Additional Details

This PR resolves:

UXPLATFORM-8025


Thank you for contributing to Terra.
@cerner/terra

@github-actions github-actions bot temporarily deployed to preview-pr-1969 January 8, 2024 08:43 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-1969 January 8, 2024 08:56 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-1969 January 8, 2024 10:26 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-1969 January 8, 2024 11:30 Destroyed
@saket2403 saket2403 self-requested a review January 8, 2024 14:18
package.json Outdated
@@ -80,7 +80,7 @@
"start-static": "npm run compile:prod && terra express-server --site build",
"test": "npm run lint && npm run jest && npm run wdio",
"test:docker": "npm run lint && npm run jest && npm run wdio:docker",
"wdio": "terra wdio --themes terra-default-theme clinical-lowlight-theme orion-fusion-theme",
"wdio": "terra wdio --themes terra-default-theme clinical-lowlight-theme orion-fusion-theme --spec packages/terra-date-time-picker/tests/wdio/date-time-picker-mobile-spec.js",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks done 5723e35

@github-actions github-actions bot temporarily deployed to preview-pr-1969 January 8, 2024 15:39 Destroyed
@ashishkumbhare116 ashishkumbhare116 marked this pull request as ready for review January 9, 2024 04:43
@github-actions github-actions bot temporarily deployed to preview-pr-1969 January 9, 2024 05:52 Destroyed
@@ -733,7 +733,7 @@ const DatePickerInput = (props) => {
size="2"
pattern="\d*"
aria-required={required}
aria-label={intl.formatMessage({ id: 'Terra.datePicker.dayLabel' })}
aria-label={ariaLabel ? `${ariaLabel} ${intl.formatMessage({ id: 'Terra.datePicker.dayLabel' })} ` : intl.formatMessage({ id: 'Terra.datePicker.dayLabel' })}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that screen reader gives pause after reading aria-label value

Suggested change
aria-label={ariaLabel ? `${ariaLabel} ${intl.formatMessage({ id: 'Terra.datePicker.dayLabel' })} ` : intl.formatMessage({ id: 'Terra.datePicker.dayLabel' })}
aria-label={ariaLabel ? `${ariaLabel}, ${intl.formatMessage({ id: 'Terra.datePicker.dayLabel' })} ` : intl.formatMessage({ id: 'Terra.datePicker.dayLabel' })}

Copy link
Contributor

@supreethmr supreethmr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to review this again, as screen readers were not able to communicate the label value as expected.

@@ -734,7 +734,7 @@ const DatePickerInput = (props) => {
pattern="\d*"
aria-required={required}
aria-label={intl.formatMessage({ id: 'Terra.datePicker.dayLabel' })}
aria-describedby={dateFormatOrder === DateUtil.dateOrder.DMY ? `${nameLabelId} ${ariaDescriptionIds}` : ariaDescriptionIds}
aria-describedby={`${nameLabelId} ${ariaDescriptionIds}`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
aria-describedby={`${nameLabelId} ${ariaDescriptionIds}`}
aria-describedby={`${nameLabelId}, ${ariaDescriptionIds}`}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The utilization of commas in this context may lead to suboptimal behavior with assistive technologies -as per the MDN websites

@@ -765,7 +765,7 @@ const DatePickerInput = (props) => {
pattern="\d*"
aria-required={required}
aria-label={intl.formatMessage({ id: 'Terra.datePicker.monthLabel' })}
aria-describedby={dateFormatOrder === DateUtil.dateOrder.MDY ? `${nameLabelId} ${ariaDescriptionIds}` : ariaDescriptionIds}
aria-describedby={`${nameLabelId} ${ariaDescriptionIds}`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
aria-describedby={`${nameLabelId} ${ariaDescriptionIds}`}
aria-describedby={`${nameLabelId}, ${ariaDescriptionIds}`}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The utilization of commas in this context may lead to suboptimal behavior with assistive technologies -as per the MDN websites

@@ -796,7 +796,7 @@ const DatePickerInput = (props) => {
pattern="\d*"
aria-required={required}
aria-label={intl.formatMessage({ id: 'Terra.datePicker.yearLabel' })}
aria-describedby={dateFormatOrder === DateUtil.dateOrder.YMD ? `${nameLabelId} ${ariaDescriptionIds}` : ariaDescriptionIds}
aria-describedby={`${nameLabelId} ${ariaDescriptionIds}`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
aria-describedby={`${nameLabelId} ${ariaDescriptionIds}`}
aria-describedby={`${nameLabelId}, ${ariaDescriptionIds}`}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The utilization of commas in this context may lead to suboptimal behavior with assistive technologies -as per the MDN websites

/**
* The label of the form control children.
*/
label: PropTypes.node,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be renamed as ariaLabel since it is not used for visual display

@@ -1106,7 +1106,7 @@ class TimeInput extends React.Component {
{...inputAttributes}
{...minuteAttributes}
refCallback={(inputRef) => { this.minuteInput = inputRef; }}
label={intl.formatMessage({ id: 'Terra.timeInput.minutes' })}
label={intl.formatMessage({ id: 'Terra.timeInput.minutes' }, { a11yLabel: this.a11yLabel })}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to send this as object value ..??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case i have followed the previous code standard as it is being used for Hours field

@supreethmr
Copy link
Contributor

@ashishkcerner I would suggest to update this PR only with fix for space issue ( OR create a new PR only with space fix) and label issue can be re-validated after some of the existing PR's are merged. I see this PR also addressing issue of label ( error message ) so it's better re-validate the label reading issue after the PR #1975. is merged

@github-actions github-actions bot temporarily deployed to preview-pr-1969 January 23, 2024 17:59 Destroyed
@ashishkumbhare116
Copy link
Contributor Author

ashishkumbhare116 commented Jan 24, 2024

Have raised a new PR excluding label screenreader reading issue .#2009

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants