-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
Refactor modal to be on each file rather than in the top level section. This lets us use the triggerButton for handling focus.
There was a problem hiding this 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} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.