Skip to content

EES-5943 Fix delete ancillary file modal focus restoration #5697

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

Merged
merged 5 commits into from
Mar 21, 2025

Conversation

Guy-HiveIT
Copy link
Collaborator

This PR refactors the "delete supporting file upload" modal to be rendered for each file rather than shared in the top level section.
This lets us use the triggerButton for handling focus, so focus can be restored to the 'Delete file' button when the modal is closed.

Refactor modal to be on each file rather than in the top level section.
This lets us use the triggerButton for handling focus.
Copy link
Collaborator

@amyb-hiveit amyb-hiveit left a comment

Choose a reason for hiding this comment

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

Just one little thing to sort out, otherwise looks good 👍

@@ -80,7 +87,21 @@ export default function AncillaryFileSummaryList({
>
Edit file
</Link>
<ButtonText onClick={onDelete}>Delete file</ButtonText>
<ModalConfirm
open={deleteFile && deleteFile.id === file.id}
Copy link
Collaborator

Choose a reason for hiding this comment

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

deleteFile isn't being passed in from ReleaseFileUploadsSection so I don't think this is needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, I thought I was passing that through and that was determining whether the modal was open! Apparently not.. Will remove here.

@Guy-HiveIT Guy-HiveIT requested a review from amyb-hiveit March 20, 2025 13:38
@Guy-HiveIT Guy-HiveIT merged commit 326dbbb into dev Mar 21, 2025
11 checks passed
@Guy-HiveIT Guy-HiveIT deleted the EES-5943-ancillary-file-modal branch March 21, 2025 09:06
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.

2 participants