Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Form] Make sure errors are a part of the label on bootstrap 4 - this is a requirement for WCAG2#24435

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:3.4fromNyholm:form-wcag-error
Feb 4, 2018

Conversation

@Nyholm
Copy link
Member

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PRsymfony/symfony-docs#...

I recently let Europe's leading accessibility experts (Funkanu.se) review a site of mine, they gave me (among other) the feedback that errors should be a part of the label.

They said that it makes no sense for blind users to read label, read input and then read errors.

I know the implementation might look strange. But I wish something like this would be merged. That would be great for accessibility for all apps using Symfony.

Wecould also make sure it prints something like:

<label for=”name”>Name: <span class=”hidden”>Error message</span></label><input id=”name” type=”text”><span aria-hidden=”true”>Error message</span>

@fabpot
Copy link
Member

Is it really something that we could only implement for Bootstrap 4? Wouldn't it make sense to make the change to the other themes? Also, for Bootstrap 4, it should be done on 3.4, not master.

@ostrolucky
Copy link
Contributor

Wouldn't changing this in older themes be BC break?
Bootstrap 4 theme has been added in Symfony 3.4 so it's ok to do this there.

@fabpot
Copy link
Member

@ostrolucky I know that, but it's kind of weird to fix a real issue only for one theme.

@nicolas-grekasnicolas-grekas changed the base branch frommaster to3.4October 8, 2017 16:47
@nicolas-grekasnicolas-grekas added this to the3.4 milestoneOct 8, 2017
@nicolas-grekas
Copy link
Member

@Nyholm rebase on 3.4 needed (I already retargeted on github)

@nicolas-grekas
Copy link
Member

@Nyholm I just rebased on 3.4. Can you please review other comments?

@Nyholm
Copy link
MemberAuthor

Nyholm commentedOct 12, 2017 via email

Thank you for reviews and comments. I'll take care of this tonight.//Tobias NyholmSkickat på språng
On 12 Oct 2017, at 09:16, Nicolas Grekas ***@***.***> wrote:@Nyholm I just rebased on 3.4. Can you please review other comments? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

@Nyholm
Copy link
MemberAuthor

I've updated all the themes.
Please note that the design (depending on CSS) might break with these fixes.

If we are happy with the implementation I'll try to write a paragraph or two in the docs about this and how to remove the error from the label.

@xabbuh
Copy link
Member

tests seem to need an update too

@Nyholm
Copy link
MemberAuthor

I updated some tests. It passes locally. Travis is not all happy, did I do it correctly?

@nicolas-grekas
Copy link
Member

nicolas-grekas commentedNov 12, 2017
edited
Loading

@Nyholm could you rebase + check tests please?

@Nyholm
Copy link
MemberAuthor

I've rebased and fixed one test.. I cannot figure out how to fixAbstractTableLayoutTest::testNestedFormError. Where is the documentation of DomCrawler?

[
./tr/td/ul[./li[.="[trans]Error![/trans]"]]
./tr/td/label/ul[./li[.="[trans]Error![/trans]"]]
/following-sibling::table[@id="name_child"]
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This line is wrong. I cannot figure out how to make it right. It should match:

<tableid="my&amp;id"class="my&amp;class"><tr><td><labelclass="required">[trans]Child[/trans]<ul><li>[trans]Error![/trans]</li></ul></label></td><td><tableid="name_child"><tr><td><labelclass="required">[trans]Grand child[/trans]</label></td><td><tableid="name_child_grandChild"></table></td></tr></table></td></tr><trstyle="display: none"><tdcolspan="2"><inputtype="hidden"id="name__token"name="name[_token]"></td></tr></table>

@xabbuh
Copy link
Member

@Nyholm Tests for the TwigBridge are green now. But it looks like you need to update some PHP templates too (see the failing FrameworkBundle tests).

@Nyholm
Copy link
MemberAuthor

Tests are green except for low/high. Also, Fabbot is a false negative

{%-else -%}
{%-setlabel_attr=label_attr|merge({class: (label_attr.class|default('') ~' form-control-label')|trim}) -%}
{%-endif -%}
{%-setlabel_attr=label_attr|merge({class: (label_attr.class|default('') ~' form-control-label')|trim}) -%}
Copy link
Contributor

Choose a reason for hiding this comment

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

the indention is broken

@Tobion
Copy link
Contributor

Don't merge such a bc break in a minor version

@nicolas-grekas
Copy link
Member

@Nyholm how could we move forward here?

@ostrolucky
Copy link
Contributor

I think this is still ok to go into bootstrap 4 theme, since that one needs to be changed in BC breaking way anyway to support newer bootstrap 4 release

@nicolas-grekas
Copy link
Member

@Nyholm because we cannot break BC, except on bootstrap 4 because it was not even stable before, what about focusing this PR only on bootstrap 4? That'd be a nice step. Would you have some time to make it before next release? (ie this week would be great)

@Nyholm
Copy link
MemberAuthor

Hey. Sorry for the delay. I will make sure to only change the bootstrap theme this week.

@NyholmNyholmforce-pushed theform-wcag-error branch 2 times, most recently from82ee2da to3eb9e41CompareJanuary 28, 2018 15:33
@Nyholm
Copy link
MemberAuthor

There we go. The PR does only edit bootstrap 4 and added some tests to make sure it works.

I've also rebased on branch 3.4. But I guess it should be changed to master, right?

@nicolas-grekas
Copy link
Member

nicolas-grekas commentedJan 28, 2018
edited
Loading

This should really go to 3.4 as bug fix. Later would mean BC breaks. Doing now is also a BC break, but matches the fact that BS4 just when out of beta.

@Nyholm
Copy link
MemberAuthor

Great great great. Then Im done with this PR. Im ready for a review.

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

(with minor nitpicking comments)

{%-ifwith_invert %}{{ form_widget(form.invert) }}{%endif -%}
</div>
{%-endif -%}
{%-endblockdateinterval_widget -%}

Choose a reason for hiding this comment

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

the last dash could be removed, just to remove an unneeded change in the patch

{%-setelement='legend' -%}
{%-setlabel_attr=label_attr|merge({class: (label_attr.class|default('') ~' col-form-legend')|trim}) -%}
{%-else -%}
{%-setlabel_attr=label_attr|merge({'for':id,class: (label_attr.class|default('') ~' form-control-label')|trim}) -%}

Choose a reason for hiding this comment

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

no need for quotes around key (same below)

@Nyholm
Copy link
MemberAuthor

Thank you

@nicolas-grekasnicolas-grekas changed the title[Form] Make sure errors is a part of the label. This is a requirement for WCAG2[Form] Make sure errors are a part of the label on bootstrap 4 - this is a requirement for WCAG2Feb 4, 2018
@nicolas-grekas
Copy link
Member

Thank you@Nyholm.

@nicolas-grekasnicolas-grekas merged commita0b40f5 intosymfony:3.4Feb 4, 2018
nicolas-grekas added a commit that referenced this pull requestFeb 4, 2018
…ap 4 - this is a requirement for WCAG2 (Nyholm)This PR was merged into the 3.4 branch.Discussion----------[Form] Make sure errors are a part of the label on bootstrap 4 - this is a requirement for WCAG2| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->I recently let Europe's leading accessibility experts (Funkanu.se) review a site of mine, they gave me (among other) the feedback that errors should be a part of the label.They said that it makes no sense for blind users to read label, read input and then read errors.I know the implementation might look strange. But I wish something like this would be merged. That would be great for accessibility for all apps using Symfony.We *could* also make sure it prints something like:```<label for=”name”>Name: <span class=”hidden”>Error message</span></label><input id=”name” type=”text”><span aria-hidden=”true”>Error message</span>```Commits-------a0b40f5 [Form] Make sure errors are a part of the label on bootstrap 4 - this is a requirement for WCAG2
@NyholmNyholm deleted the form-wcag-error branchFebruary 4, 2018 15:34
@Nyholm
Copy link
MemberAuthor

Thank you for merging.

nicolas-grekas added a commit that referenced this pull requestFeb 15, 2018
…le (mpiot, Nyholm)This PR was merged into the 3.4 branch.Discussion----------[TwigBridge] Apply some changes to support Bootstrap4-stable| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#25655#25635#24435| License       | MIT| Doc PR        | -Follow up of#25715, see discussion there.This fixes the following errors:- Delete form-control-label, don't used in Bootstrap 4- Replace col-form-legend by col-form-label- Separate the label and input (before the input was in the label)- Use form-check-inline to put radio and/or checkboxes inline- Add support of custom form for radio and checkboxes- Fix input-group: MoneyType (Issue#25655), PercentType- Remove form-control duplication (Issue#25635)- Fix Errors in label (#24435)Commits-------14e2282 Fixed broken testscf4e956 [TwigBridge] Apply some changes to support Bootstrap4-stable
This was referencedMar 1, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@TobionTobionTobion left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

8 participants

@Nyholm@fabpot@ostrolucky@nicolas-grekas@xabbuh@Tobion@jawadmjn@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp