Skip to content

Commit

Permalink
Added aria-disabled=true for disabled pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
saracarl authored and mislav committed May 9, 2021
1 parent 07a2647 commit 31ed281
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/will_paginate/view_helpers/link_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def previous_or_next_page(page, text, classname)
if page
link(text, page, :class => classname)
else
tag(:span, text, :class => classname + ' disabled')
tag(:span, text, :class => classname + ' disabled', :"aria-disabled" => true)
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/view_helpers/action_view_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def renderer.gap() '<span class="my-gap">~~</span>' end
it "should match expected markup" do
paginate
expected = <<-HTML
<div class="pagination" role="navigation" aria-label="Pagination"><span class="previous_page disabled">&#8592; Previous</span>
<div class="pagination" role="navigation" aria-label="Pagination"><span class="previous_page disabled" aria-disabled="true">&#8592; Previous</span>
<em class="current" aria-label="Page 1" aria-current="page">1</em>
<a href="/foo/bar?page=2" aria-label="Page 2" rel="next">2</a>
<a href="/foo/bar?page=3" aria-label="Page 3">3</a>
Expand Down

0 comments on commit 31ed281

Please sign in to comment.