Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAK-40229 Content screen reader announcing file upload to dropbox #12995

Merged
merged 7 commits into from
Nov 26, 2024

Conversation

Sharadhi98
Copy link
Contributor

No description provided.

Comment on lines +201 to +205
else
{
feedback.classList.add('d-none');
nameField.value = '';
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need else block ? when there's no file selected nothing changes and d-none is already present.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked that when I deselect a file, the message and display name do not disappear. That's why I added the else block and it works as intended.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kunaljaykam can you please review this and let me know if any changes are required?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct. I tested your pr. The else block is necessary to clear outdated file info when the file picker is opened but no new file is selected. Without it, the old file name and feedback message remain and causes console error.

I think we should re-write the whole handleFileChange function it looks messy, and include the display name field inside; fileField.files.length > 0) check as well so display name gets updates as well.

Copy link
Member

@kunaljaykam kunaljaykam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks @Sharadhi98

nameField.value = fileField.files[0].name;
}
previousFileName = fileField.files[0].name;
## Goal: update the display name field. But if the user provided their own display name, don't overwrite it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spacing

@ern ern merged commit 5e409bf into sakaiproject:master Nov 26, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants