Skip to content

Conversation

@austingreendev
Copy link
Contributor

@austingreendev austingreendev commented Sep 18, 2018

No breaking changes with this one 🎉 Wraps up #66

Everything should be backwards compatible and act as a single feat release.

Description

This PR closes up the remaining work in #66 and removes the last of the AXE auditing failures.

Detail

This PR includes assorted DOC changes, aria-labels for examples, and some wording tweaks, but the majority of changes are:

  • AutocompleteContainer
    • Remove invalid aria-owns value
  • MenuContainer
    • Remove invalid aria-controls value
  • FieldContainer
    • Now optionally include the aria-describedby values based on an optional customization
  • Checkbox | Radio | Ranges | Textfields | Toggles
    • Use the new FieldContainer with updates

Checklist

  • 👌 design updates are Garden Designer approved (add the
    designer as a reviewer)
  • 💅 view component styling is based on a Garden CSS
    component
  • 🌐 Styleguidist demo is up-to-date (yarn start)
  • ⬅️ renders as expected with reversed (RTL) direction
  • 💂‍♂️ includes new unit and snapshot tests
  • 📒 any new files are included in the packages src/index.js export
  • 📝 tested in Chrome, Firefox, Safari, Edge, and IE11

@coveralls
Copy link

coveralls commented Sep 18, 2018

Coverage Status

Coverage increased (+0.02%) to 95.939% when pulling fbbe2bc on austin94/accessible-forms into c907f6d on master.


it('applies container props to Message', () => {
expect(wrapper.find(Message)).toHaveProp('id', `${CHECKBOX_ID}--message`);
expect(wrapper.find(Message)).toHaveProp('role', 'alert');
Copy link
Contributor

Choose a reason for hiding this comment

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

role alert will interrupt the screen reader and read that message when it appears is that what we want?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From the MDN ARIA techniques docj it mentions a use-case

- An invalid value was entered into a form field 

We current use the getMessageProps value on all of our success/warning/error messages so I thought it would be applicable as we normally only show this dynamically based on input states.

Copy link
Contributor

Choose a reason for hiding this comment

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

But that isn't always the case right? I can not supply a prop and use it to just display ancillary message that may not be validation related.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But that isn't always the case right?

True. I forgot about our default <Message />.

If I were to remove the role prop that would remove the need for getMessageProps entirely! It would be a breaking change, but would clean up the API some.

Copy link
Contributor

@ryanseddon ryanseddon Sep 21, 2018

Choose a reason for hiding this comment

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

Could you do some logic there that if there is no validation prop or it's value is none don't apply the role alert?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could conditionally apply the getMessageProps based on that value. Or would that be too abstract?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm not sure I think consumers would be used to using propGetter pattern.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I think it would be best to start the deprecation process on this one. In the most recent commit I've:

  • Added a deprecation warning to getMessageProps
  • Updated testing to cover deprecation warning
  • Remove all internal uses of getMessageProps in the form related components.

@austingreendev austingreendev force-pushed the austin94/accessible-forms branch from 452e527 to fbbe2bc Compare September 26, 2018 21:31
@austingreendev austingreendev merged commit b60d56a into master Sep 27, 2018
@austingreendev austingreendev deleted the austin94/accessible-forms branch September 27, 2018 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants