Skip to content

Commit 29f0364

Browse files
author
Gabriel Schulhof
committed
Textinput: Add aria-hidden="true" to clear button and test correct markup
Closes jquery-archivegh-7647
1 parent 826ada0 commit 29f0364

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

js/widgets/forms/clearButton.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ define( [
3030
},
3131

3232
clearButton: function() {
33-
return $( "<a href='#' tabindex='-1' " +
33+
return $( "<a href='#' tabindex='-1' aria-hidden='true' " +
3434
"class='ui-input-clear ui-btn ui-icon-delete ui-btn-icon-notext ui-corner-all'>" +
3535
"</a>" )
3636
.attr( "title", this.options.clearBtnText )

tests/unit/textinput/textinput_core.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@
9797
});
9898

9999
test( "data-clear-btn adds clear button to text inputs", function() {
100-
ok( $( '#text-input-clear-btn' ).next().is( 'a.ui-input-clear' ), "data-clear-btn adds clear button to text inputs" );
100+
ok( $( '#text-input-clear-btn' ).next()
101+
.is( 'a.ui-input-clear[tabindex="-1"][aria-hidden="true"]' ),
102+
"correctly marked up clear button is present" );
101103
});
102104

103105
test( "data-clear-btn does not add clear button to textarea", function() {

0 commit comments

Comments
 (0)