Skip to content
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

Forms #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions proposed/form.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Parsy Pattern Design Doc

Parsy

#Form

* Author: `Lorenzo Wallerlei, [email protected]`
* Date: `19-01-2017`
* Repository name: `FormComponent`

## Goals

This document is the proposal for the form component, it describes what should go in a form and how a form should react
to user input.

## References

http://getbootstrap.com/components/#input-groups

http://foundation.zurb.com/sites/docs/forms.html

http://webaim.org/techniques/forms/controls

## Requirements

- All the inputs within the form SHOULD contain a tab index.
- All the inputs SHOULD have error messages if there is some sort of validation on that specific input
- Inputs MUST have labels
- Form MUST have an action attribute
- If there is a collection of inputs it MUST be surrounded by a fieldset.
- If you use an fieldset you MUST use a legend for it.

# Case studies `<Optional>`

Not applied.

## Existing implementations

[https://www.tax.service.gov.uk/gg/sign-in?continue=%2Faccount&origin=unknown]
Copy link
Contributor

Choose a reason for hiding this comment

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

You mean to show the login form at this page or is there an url behind the login?


What it does good.
- Form fields are described by labels.
- Flow of the tab indexes is natural.
Copy link
Contributor

Choose a reason for hiding this comment

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

The login form at this URL does not have tabindex attributes set. The flow is logical because by itself already. Just saying :)

- Clear error messages.
- Submits with the enter key.
- Has a form action so it could be submitted without the use of javascript.

What it could do better.
- Refocus after validation.

## Proof of concept

This pattern has no proof of concept. It is a set of rules to follow for making a good structured, valid and accessible
form.

## API

Not used.

## Constraints

TBD.

## Classes

Name | Type | Description
-----------|----------|-------------

has-errors | "global" | Can make it easier for other componts to know if the form has errors.


## Accessibility `<Important>`

TBD.

### How to use the component with a keyboard only

This MUST be entirely usable with only the tab key.
Copy link
Contributor

Choose a reason for hiding this comment

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

How would you submit it with a tab key? You need to clarify this sentence.You probably mean to say that it should be usuable with the keyboard.


### How a screen-reader user will interact with the component

- The screen reader reads all the labels of the form inputs
- If a input has a description, use aria-describedby so the screen reader can read the description.

### How the component will work without color

Not applicable.

### How the component will enforce any a11y requirements

I need some help with this point.

## Roadmap and timeline

Not applicable.

[this article]: https://www.polymer-project.org/0.5/articles/accessible-web-components.html
[Daltonize]: https://chrome.google.com/webstore/detail/chrome-daltonize/efeladnkafmoofnbagdbfaieabmejfcf
[SEE]: https://chrome.google.com/webstore/detail/see/dkihcccbkkakkbpikjmpnbamkgbjfdcn
[WAI-ARIA Authoring Practices doc]: https://www.polymer-project.org/0.5/articles/accessible-web-components.html
[codepen]: https://codepen.io