diff --git a/NEWS.md b/NEWS.md index d0ee9b14..02401dbe 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,6 +9,10 @@ * Supports `flextable` and `gtsummary` objects. * Soft deprecated `ReportCard`. +### Enhancements + +* Enhanced keyboard accessibility in the download modal - users can now press Enter from any input field to trigger the download action. + # teal.reporter 0.5.0 ### Breaking changes diff --git a/R/download.R b/R/download.R index 61f30909..b7c6b078 100644 --- a/R/download.R +++ b/R/download.R @@ -99,11 +99,17 @@ download_report_button_srv <- function(id, shiny::tags$br() ) }, - reporter_download_inputs( - rmd_yaml_args = rmd_yaml_args, - rmd_output = rmd_output, - showrcode = any_rcode_block(reporter), - session = session + shiny::tags$form( + onsubmit = sprintf( + "event.preventDefault(); document.getElementById('%s').click();", + ns("download_data") + ), + reporter_download_inputs( + rmd_yaml_args = rmd_yaml_args, + rmd_output = rmd_output, + showrcode = any_rcode_block(reporter), + session = session + ) ), footer = shiny::tagList( shiny::tags$button(