-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1558 from /issues/1492@v2
checkbox, checkbox-group: improve JAWS readability
- Loading branch information
Showing
12 changed files
with
63 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
common.blocks/checkbox-group/checkbox-group.tmpl-specs/10-no_type_disabled_item.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
<span class="checkbox-group checkbox-group_theme_islands checkbox-group_size_m control-group i-bem" data-bem="{"checkbox-group":{}}"><label class="checkbox checkbox_theme_islands checkbox_size_m i-bem" data-bem="{"checkbox":{}}"><span class="checkbox__box"><input class="checkbox__control" type="checkbox" autocomplete="off" name="default" value="1"/></span>first</label><br/><label class="checkbox checkbox_theme_islands checkbox_size_m checkbox_checked checkbox_disabled i-bem" data-bem="{"checkbox":{}}"><span class="checkbox__box"><input class="checkbox__control" type="checkbox" autocomplete="off" name="default" value="3" checked="checked" disabled="disabled"/></span>third</label></span> | ||
<span class="checkbox-group checkbox-group_theme_islands checkbox-group_size_m control-group i-bem" role="group" aria-label="." data-bem="{"checkbox-group":{}}"> | ||
<label class="checkbox checkbox_theme_islands checkbox_size_m i-bem" data-bem="{"checkbox":{}}"> | ||
<span class="checkbox__box"><input class="checkbox__control" type="checkbox" autocomplete="off" name="default" value="1"/></span> | ||
<span aria-hidden="true" class="checkbox__text">first</span> | ||
</label><br/> | ||
<label class="checkbox checkbox_theme_islands checkbox_size_m checkbox_checked checkbox_disabled i-bem" data-bem="{"checkbox":{}}"> | ||
<span class="checkbox__box"><input class="checkbox__control" type="checkbox" autocomplete="off" name="default" value="3" checked="checked" disabled="disabled"/></span> | ||
<span aria-hidden="true" class="checkbox__text">third</span> | ||
</label> | ||
</span> |
11 changes: 10 additions & 1 deletion
11
common.blocks/checkbox-group/checkbox-group.tmpl-specs/20-type_button_disabled_group.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
<span class="checkbox-group checkbox-group_type_button checkbox-group_disabled control-group i-bem" data-bem="{"checkbox-group":{}}"><label class="checkbox checkbox_type_button checkbox_disabled i-bem" data-bem="{"checkbox":{}}"><button class="button button_togglable_check button_disabled button__control i-bem" aria-pressed="false" data-bem="{"button":{}}" role="button" type="button" disabled="disabled"><span class="button__text">first</span></button><input class="checkbox__control" type="checkbox" autocomplete="off" disabled="disabled"/></label><label class="checkbox checkbox_type_button checkbox_disabled i-bem" data-bem="{"checkbox":{}}"><button class="button button_togglable_check button_disabled button__control i-bem" aria-pressed="false" data-bem="{"button":{}}" role="button" type="button" disabled="disabled"><i aria-hidden="true" class="icon icon_social_vk"></i><span class="button__text">VK</span></button><input class="checkbox__control" type="checkbox" autocomplete="off" disabled="disabled"/></label></span> | ||
<span class="checkbox-group checkbox-group_type_button checkbox-group_disabled control-group i-bem" role="group" aria-label="." data-bem="{"checkbox-group":{}}"> | ||
<label class="checkbox checkbox_type_button checkbox_disabled i-bem" data-bem="{"checkbox":{}}"> | ||
<button class="button button_togglable_check button_disabled button__control i-bem" role="button" type="button" disabled="disabled" aria-pressed="false" data-bem="{"button":{}}"><span class="button__text">first</span></button> | ||
<input class="checkbox__control" type="checkbox" autocomplete="off" disabled="disabled"/> | ||
</label> | ||
<label class="checkbox checkbox_type_button checkbox_disabled i-bem" data-bem="{"checkbox":{}}"> | ||
<button class="button button_togglable_check button_disabled button__control i-bem" role="button" type="button" disabled="disabled" aria-pressed="false" data-bem="{"button":{}}"><i class="icon icon_social_vk" aria-hidden="true"></i><span class="button__text">VK</span></button> | ||
<input class="checkbox__control" type="checkbox" autocomplete="off" disabled="disabled"/> | ||
</label> | ||
</span> |
4 changes: 3 additions & 1 deletion
4
common.blocks/checkbox-group/checkbox-group.tmpl-specs/30-empty.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
<span class="checkbox-group control-group i-bem" data-bem="{"checkbox-group":{}}"><label class="checkbox checkbox_checked i-bem" data-bem="{"checkbox":{}}"><span class="checkbox__box"><input class="checkbox__control" type="checkbox" autocomplete="off" checked="checked" value="1"/></span></label></span> | ||
<span class="checkbox-group control-group i-bem" role="group" aria-label="." data-bem="{"checkbox-group":{}}"> | ||
<label class="checkbox checkbox_checked i-bem" data-bem="{"checkbox":{}}"><span class="checkbox__box"><input class="checkbox__control" type="checkbox" autocomplete="off" value="1" checked="checked"/></span></label> | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
block('checkbox').elem('text')( | ||
tag()('span'), | ||
attrs()(function() { | ||
return { 'aria-hidden' : true }; | ||
}) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = function(bh) { | ||
bh.match('checkbox__text', function(ctx) { | ||
ctx | ||
.tag('span') | ||
.attr('aria-hidden', true); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,10 @@ block('checkbox')( | |
val : ctx.val | ||
} | ||
}, | ||
ctx.text | ||
ctx.text && { | ||
elem : 'text', | ||
content : ctx.text | ||
} | ||
]; | ||
}) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
<label class="checkbox checkbox_checked checkbox_disabled i-bem" data-bem="{"checkbox":{}}"><span class="checkbox__box"><input class="checkbox__control" type="checkbox" autocomplete="off" name="checkbox-name" value="checkbox-val" checked="checked" disabled="disabled"/></span>checkbox-text</label> | ||
<label class="checkbox checkbox_checked checkbox_disabled i-bem" data-bem="{"checkbox":{}}"> | ||
<span class="checkbox__box"><input class="checkbox__control" type="checkbox" autocomplete="off" name="checkbox-name" value="checkbox-val" checked="checked" disabled="disabled"/></span> | ||
<span aria-hidden="true" class="checkbox__text">checkbox-text</span> | ||
</label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
<label class="checkbox i-bem" data-bem="{"checkbox":{}}"><span class="checkbox__box"><input class="checkbox__control" type="checkbox" autocomplete="off"/></span></label> | ||
<label class="checkbox i-bem" data-bem="{"checkbox":{}}"> | ||
<span class="checkbox__box"><input class="checkbox__control" type="checkbox" autocomplete="off"/></span> | ||
</label> |