Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[60904] Accessibility for new datepicker (#18492)

Behrokh Satarnejad3f8b73cec0be
diff --git a/app/components/work_packages/date_picker/date_form_component.html.erb b/app/components/work_packages/date_picker/date_form_component.html.erb
index 840224502c3..5eaa34764b2 100644
--- a/app/components/work_packages/date_picker/date_form_component.html.erb
+++ b/app/components/work_packages/date_picker/date_form_component.html.erb
@@ -18,7 +18,7 @@
end
start_date.with_row(classes: "wp-datepicker-dialog-date-form--text-field-container") do
- render(Primer::Alpha::TextField.new(**text_field_options(name: :start_date, label: start_date_label)))
+ render(Primer::Alpha::TextField.new(**text_field_options(name: :start_date, label: start_date_label), aria: { live: :polite }))
end
start_date.with_row(classes: "wp-datepicker-dialog-set-today-link") do
render_today_link(name: :start_date)
@@ -45,7 +45,7 @@
end
due_date.with_row(classes: "wp-datepicker-dialog-date-form--text-field-container") do
- render(Primer::Alpha::TextField.new(**text_field_options(name: :due_date, label: I18n.t("attributes.due_date"))))
+ render(Primer::Alpha::TextField.new(**text_field_options(name: :due_date, label: I18n.t("attributes.due_date")), aria: { live: :polite }))
end
due_date.with_row(classes: "wp-datepicker-dialog-set-today-link") do
render_today_link(name: :due_date)
@@ -54,7 +54,7 @@
end
body.with_column(classes: "wp-datepicker-dialog-date-form--duration") do
- render(Primer::Alpha::TextField.new(**text_field_options(name: :duration, label: WorkPackage.human_attribute_name("duration"))))
+ render(Primer::Alpha::TextField.new(**text_field_options(name: :duration, label: WorkPackage.human_attribute_name("duration")), aria: { live: :polite }))
end
end
end
diff --git a/spec/components/work_packages/date_picker/dialog_content_component_spec.rb b/spec/components/work_packages/date_picker/dialog_content_component_spec.rb
index 633b4fcea37..a7eb85e5ee7 100644
--- a/spec/components/work_packages/date_picker/dialog_content_component_spec.rb
+++ b/spec/components/work_packages/date_picker/dialog_content_component_spec.rb
@@ -50,8 +50,9 @@ RSpec.describe WorkPackages::DatePicker::DialogContentComponent, type: :componen
let(:schedule_manually) { true }
it "shows the date form" do
- expect(dialog_content).to have_field(I18n.t("attributes.start_date"))
- expect(dialog_content).to have_field(I18n.t("attributes.due_date"))
+ expect(dialog_content).to have_field(I18n.t("attributes.start_date"), aria: { live: :polite })
+ expect(dialog_content).to have_field(I18n.t("attributes.due_date"), aria: { live: :polite })
+ expect(dialog_content).to have_field(WorkPackage.human_attribute_name("duration"), aria: { live: :polite })
end
it "has an enabled save button" do