Commit 129ab835 authored by Joon Ahn's avatar Joon Ahn Committed by Commit Bot

Feedback window: Announce file size limit on repeated selection.

Instead of hiding attach-error on fileSelect callback, hook onto the click event to clear out attach-error before fileselected callback is called. This will reannounce the alert as needed.

BUG=chromium:1020047
TEST=ChromeVox on ChromeOS. Verify by choosing files over 3mb over and
over.

Change-Id: I2e41d61c1bc226573a4cc1a30f675b5a6693c486
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1936763Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Reviewed-by: default avatarIan Barkley-Yeung <iby@chromium.org>
Commit-Queue: Joon Ahn <joonbug@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721167}
parent d85396d3
...@@ -99,7 +99,6 @@ let sysInfoPageOnSysInfoReadyCallback = null; ...@@ -99,7 +99,6 @@ let sysInfoPageOnSysInfoReadyCallback = null;
* @param {Event} fileSelectedEvent The onChanged event for the file input box. * @param {Event} fileSelectedEvent The onChanged event for the file input box.
*/ */
function onFileSelected(fileSelectedEvent) { function onFileSelected(fileSelectedEvent) {
$('attach-error').hidden = true;
const file = fileSelectedEvent.target.files[0]; const file = fileSelectedEvent.target.files[0];
if (!file) { if (!file) {
// User canceled file selection. // User canceled file selection.
...@@ -119,6 +118,14 @@ function onFileSelected(fileSelectedEvent) { ...@@ -119,6 +118,14 @@ function onFileSelected(fileSelectedEvent) {
attachedFileBlob = file.slice(); attachedFileBlob = file.slice();
} }
/**
* Called when user opens the file dialog. Hide $('attach-error') before file
* dialog is open to prevent a11y bug https://crbug.com/1020047
*/
function onOpenFileDialog() {
$('attach-error').hidden = true;
}
/** /**
* Clears the file that was attached to the report with the initial request. * Clears the file that was attached to the report with the initial request.
* Instead we will now show the attach file button in case the user wants to * Instead we will now show the attach file button in case the user wants to
...@@ -577,6 +584,7 @@ function initialize() { ...@@ -577,6 +584,7 @@ function initialize() {
// Setup our event handlers. // Setup our event handlers.
$('attach-file').addEventListener('change', onFileSelected); $('attach-file').addEventListener('change', onFileSelected);
$('attach-file').addEventListener('click', onOpenFileDialog);
$('send-report-button').onclick = sendReport; $('send-report-button').onclick = sendReport;
$('cancel-button').onclick = cancel; $('cancel-button').onclick = cancel;
$('remove-attached-file').onclick = clearAttachedFile; $('remove-attached-file').onclick = clearAttachedFile;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment