From 8ebf706be91ba3b39d5df43ffc527cac22498273 Mon Sep 17 00:00:00 2001 From: Julie Hardesty Date: Tue, 5 Nov 2024 16:52:18 -0500 Subject: [PATCH] Disable/enable Save button via aria-disabled attribute --- app/assets/javascripts/hyrax/file_manager/save_manager.es6 | 2 ++ app/views/hyrax/base/_file_manager_actions.html.erb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/hyrax/file_manager/save_manager.es6 b/app/assets/javascripts/hyrax/file_manager/save_manager.es6 index 55f265f5bc..9332ade446 100644 --- a/app/assets/javascripts/hyrax/file_manager/save_manager.es6 +++ b/app/assets/javascripts/hyrax/file_manager/save_manager.es6 @@ -26,8 +26,10 @@ export default class SaveManager { check_button() { if (this.is_changed) { this.save_button.removeClass("disabled") + this.save_button.attr("aria-disabled", "false") } else { this.save_button.addClass("disabled") + this.save_button.attr("aria-disabled", "true") } } diff --git a/app/views/hyrax/base/_file_manager_actions.html.erb b/app/views/hyrax/base/_file_manager_actions.html.erb index c56b5aaeee..8e1dad0c4c 100644 --- a/app/views/hyrax/base/_file_manager_actions.html.erb +++ b/app/views/hyrax/base/_file_manager_actions.html.erb @@ -1,6 +1,6 @@
- <%= button_tag t('.save'), class: "btn btn-primary disabled mr-2", data: { action: "save-actions" } %> + <%= button_tag t('.save'), class: "btn btn-primary disabled mr-2", data: { action: "save-actions" }, 'aria-disabled': true %> <%= button_tag t('.sort_alphabetically'), class: "btn btn-primary ", data: { action: "alpha-sort-action" } %>