Skip to content

Commit

Permalink
force focusing button when closing notes modal
Browse files Browse the repository at this point in the history
  • Loading branch information
bellangerq committed Jul 31, 2024
1 parent 87c47a5 commit 7d3e913
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ function handleCancelDeleteFile() {
deleteFileModalRef.value?.hide();
notesModal.value?.show();
}
// Focus the notes button when closing notes modal
const notesButtonRef = ref<HTMLButtonElement>();
function focusNotesModalButton() {
notesButtonRef.value?.focus();
}
</script>

<template>
Expand Down Expand Up @@ -437,6 +443,7 @@ function handleCancelDeleteFile() {

<li class="fr-p-0 notes-item">
<button
ref="notesButtonRef"
class="fr-btn fr-btn--secondary fr-btn--icon-left fr-icon-draft-line"
:disabled="isOffline"
@click="openNotesModal"
Expand Down Expand Up @@ -512,6 +519,7 @@ function handleCancelDeleteFile() {
:default-error-message="deleteFileErrorMessage"
@confirm="updateAuditNotes"
@delete="openDeleteFileModal"
@closed="focusNotesModalButton"
/>

<DeleteFileModal
Expand Down

0 comments on commit 7d3e913

Please sign in to comment.