Skip to content

Commit 2b4a8cc

Browse files
committed
add focus function for a11y
1 parent 78cdecc commit 2b4a8cc

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/js/components/FeedbackFormModal/index.svelte

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@
8080
<FeedbackFormBasic />
8181
{/snippet}
8282
</Modal>
83+
{:else if form == 'contact'}
84+
<Modal bind:this={modal} focusButtonOnClose scrollable>
85+
{#snippet title()}
86+
Contact HathiTrust
87+
{/snippet}
88+
{#snippet body()}
89+
{#if winterBreak}<p>{@html message}</p>{/if}
90+
<FeedbackFormBasic />
91+
{/snippet}
92+
</Modal>
8393
{:else}
8494
<Modal bind:this={modal} focusHelpOnClose scrollable>
8595
{#snippet title()}

src/js/components/Modal/index.svelte

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
if (focusMyAccountOnClose) {
8282
document.querySelector('#my-account a').focus();
8383
}
84+
if (focusButtonOnClose) {
85+
document.querySelector('#feedback-form').focus();
86+
}
8487
};
8588
8689
onMount(() => {

0 commit comments

Comments
 (0)