plone / plone.z3cform

plone.z3cform is a library that allows use of z3c.form with Zope 2 and the CMF.
GNU General Public License v2.0
0 stars 0 forks source link

Actions in crud-table.pt should be lists #9

Closed erral closed 4 years ago

erral commented 4 years ago

As part of an accessibility review of Plone 5.2 a client has told us to modify some forms in Plone. We have tracked them down to here: https://github.com/plone/plone.z3cform/blob/master/src/plone/z3cform/crud/crud-table.pt#L50

The accessibility review says that those actions should be a list of items (ul - li items in HTML) if there are multiple actions, and a single div item if there is just one item.

ale-rt commented 4 years ago

Can you paste some link that backs up this request?

I quickly looked for something like this and I found:

and it uses the pattern:

<div class="btn-group">
  <button type="button" class="btn btn-primary">Apple</button>
  <button type="button" class="btn btn-primary">Samsung</button>
  <button type="button" class="btn btn-primary">Sony</button>
</div>

which is anyway different from the one we have now:

<div class="action" tal:repeat="action view/actions/values">
   <input type="submit" tal:replace="structure action/render" />
</div>

I am wondering why we should not follow the bootstrap guideline. Can you ask the a11y people if they are fine with the bootstrap solution? CC @polyester

stevepiercy commented 4 years ago

The type attribute for button in a form should be one of submit, reset, or cancel.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type

Forms in Bootstrap 4 get it right, but not the button groups.

https://getbootstrap.com/docs/4.4/components/forms/

I, too, would like to see a citation stating that a list of buttons improves a11y.

erral commented 4 years ago

In their report, they claim that those buttons are a list of buttons and they are not marked as HTML lists as they should be.

In some other places where we have put some buttons providing an action, they have always asked them to be a list, because they are like a "group" but should be a list.

They are not more specific than that on their report.

@ionlizarazu @nruiz

erral commented 4 years ago

I would say that the reason behind wanting a list of items is that the screen reader reads them as a group or something like that (sorry, I don't have the screen reader they are using right now in this computer).