Skip to content

Commit a01009b

Browse files
committed
Add type to the event
1 parent 7987074 commit a01009b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/social/SocialSubscribe.astro

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const socialLinks = [
3434
</p>
3535

3636
<form
37-
onsubmit="handleSubscribe(event)"
37+
id="subscribeForm"
3838
class="flex flex-col sm:flex-row justify-center items-center gap-4"
3939
>
4040
<input
@@ -56,7 +56,10 @@ const socialLinks = [
5656
</div>
5757

5858
<script>
59-
async function handleSubscribe(event) {
59+
const form = document.getElementById("subscribeForm");
60+
form?.addEventListener("submit", handleSubscribe);
61+
62+
async function handleSubscribe(event: SubmitEvent) {
6063
event.preventDefault();
6164

6265
const input = document.getElementById("emailInput");

0 commit comments

Comments
 (0)