Make Collection Controls Aria Accessible#779
Conversation
This commit also identified an error in existing code where `inline: true` on the collection field wasn't generating the right classes.
|
Hi just want to comment here that I think this is a step in the right direction and to thank you for all the work. Labels for radio buttons are being read now and I believe they fit the WCAG guidelines, though I'm not an expert on the matter. |
|
Why was this made conditional on |
Issue introduced at bootstrap-ruby/bootstrap_form#779. No explanation at the time of committing.
In production, a new div was appearing showing a label that duplicated the existing one. In development, this div exists but is empty and therefore invisible. This behaviour was introduced at bootstrap-ruby/bootstrap_form#779. At the time of this commit, there's no explanation as to the dev/prod difference. What seems clear is that the prod behaviour is expected to be the default in the future, so I went for it, enabling it explicitly. Then I substituted the label I had added with the one that the form sets.
First, thanks for your patience while I found some time to reply. I have no idea why I did this, and I normally hate it when I see software that behaves differently in production than it does in development. Let me dig some more and see if I had a reason. Otherwise, I'll fix it. Thanks for catching this, and my sincere apologies for the confusion! |
Make
collection_checkboxesandcollection_radio_buttonsproduce output that's more compliant with https://www.w3.org/WAI/tutorials/forms/grouping/#associating-related-controls-with-wai-aria.Since the markup changes noticeably, this change is only enabled by setting the configuration option
group_around_collections = true:This PR includes changes in the test files:
collection_checkboxesandcollection_radio_buttontests to their own files.collection_checkboxesandcollection_radio_buttonwith thegroup_around_collectionsoptions bothtrueandfalse.Eventually, this behaviour should become the default, and later, the old behavour should disappear altogether.
Closes: #763.