Skip to content

Commit 052a080

Browse files
author
Thomas Johnson
authored
Merge pull request #3220 from samvera/revert-add-files-a11y
Revert "Update file upload buttons to be keyboard tab accessible"
2 parents f02c648 + aecfe67 commit 052a080

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

app/views/hyrax/base/_form_files.html.erb

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
<div class="row">
1414
<div class="col-xs-12">
1515
<!-- The fileinput-button span is used to style the file input field as button -->
16-
<button id="addfiles" class="btn btn-success fileinput-button">
16+
<span id="addfiles" class="btn btn-success fileinput-button">
1717
<span class="glyphicon glyphicon-plus"></span>
1818
<span>Add files...</span>
19-
<input type="file" name="files[]" tabindex="-1" aria-hidden="true" multiple />
20-
</button>
19+
<input type="file" name="files[]" multiple />
20+
</span>
2121
<!-- The fileinput-button span is used to style the file input field as button -->
22-
<button id="addfolder" class="btn btn-success fileinput-button">
22+
<span id="addfolder" class="btn btn-success fileinput-button">
2323
<span class="glyphicon glyphicon-plus"></span>
2424
<span>Add folder...</span>
25-
<input type="file" name="files[]" tabindex="-1" aria-hidden="true" multiple directory webkitdirectory />
26-
</button>
25+
<input type="file" name="files[]" multiple directory webkitdirectory />
26+
</span>
2727
<% if Hyrax.config.browse_everything? %>
2828
<%= button_tag(type: 'button', class: 'btn btn-success', id: "browse-btn",
2929
'data-toggle' => 'browse-everything', 'data-route' => browse_everything_engine.root_path,

app/views/hyrax/dashboard/collections/_form_branding.html.erb

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
<div class="row fileupload-buttonbar">
1414
<div class="col-xs-4">
1515
<!-- The fileinput-button span is used to style the file input field as button -->
16-
<button class="btn btn-success fileinput-button">
16+
<span class="btn btn-success fileinput-button">
1717
<span class="glyphicon glyphicon-plus"></span>
1818
<span>Choose File</span>
19-
<input type="file" name="files[]" tabindex="-1" aria-hidden="true" single />
20-
</button>
19+
<input type="file" name="files[]" single />
20+
</span>
2121
</div> <!-- end col-xs-4 -->
2222

2323
<!-- The global progress state -->
@@ -90,11 +90,11 @@
9090
<div class="row fileupload-buttonbar">
9191
<div class="col-xs-4">
9292
<!-- The fileinput-button span is used to style the file input field as button -->
93-
<button class="btn btn-success fileinput-button">
93+
<span class="btn btn-success fileinput-button">
9494
<span class="glyphicon glyphicon-plus"></span>
9595
<span>Choose File</span>
96-
<input type="file" name="files[]" tabindex="-1" aria-hidden="true" single />
97-
</button>
96+
<input type="file" name="files[]" single />
97+
</span>
9898
</div> <!-- end col-xs-4 -->
9999

100100
<!-- The global progress state -->

spec/features/batch_create_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
it "allows on-behalf-of batch deposit", :js do
4040
click_link "Files" # switch tab
4141
expect(page).to have_content "Add files"
42-
within('button#addfiles') do
42+
within('span#addfiles') do
4343
# two arbitrary files that aren't actually related, but should be
4444
# small enough to require minimal processessing.
4545
attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/small_file.txt", visible: false)

spec/features/create_work_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
click_link "Files" # switch tab
3131
expect(page).to have_content "Add files"
3232
expect(page).to have_content "Add folder"
33-
within('button#addfiles') do
33+
within('span#addfiles') do
3434
attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/image.jp2", visible: false)
3535
attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/jp2_fits.xml", visible: false)
3636
end
@@ -71,7 +71,7 @@
7171
it "allows on-behalf-of deposit" do
7272
click_link "Files" # switch tab
7373
expect(page).to have_content "Add files"
74-
within('button#addfiles') do
74+
within('span#addfiles') do
7575
attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/image.jp2", visible: false)
7676
attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/jp2_fits.xml", visible: false)
7777
end
@@ -113,7 +113,7 @@
113113

114114
it 'updates the required file check status' do
115115
click_link "Files" # switch to the Files tab
116-
within('button#addfiles') do
116+
within('span#addfiles') do
117117
attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/image.jp2", visible: false)
118118
end
119119
expect(page).to have_css('ul li#required-files.complete', text: 'Add files')

spec/features/dashboard/collection_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ def get_url_fragment(type)
671671

672672
# add required file
673673
click_link "Files" # switch tab
674-
within('button#addfiles') do
674+
within('span#addfiles') do
675675
attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/image.jp2", visible: false)
676676
end
677677
# set required metadata

0 commit comments

Comments
 (0)