mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-11 01:44:50 +08:00
refactor: fix accessibility of edit profile button
done by converting the popup to a form converting class button to a button type submit listening to form submit
This commit is contained in:
parent
9380542e96
commit
41aa5c61e2
2 changed files with 7 additions and 5 deletions
|
|
@ -29,6 +29,7 @@ export function show(callbackOnHide: () => void): void {
|
|||
.removeClass("hidden")
|
||||
.animate({ opacity: 1 }, 125, () => {
|
||||
hydrateInputs();
|
||||
$("#editProfilePopupWrapper").trigger("focus");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -189,7 +190,8 @@ $("#editProfilePopupWrapper").on("mousedown", (e) => {
|
|||
}
|
||||
});
|
||||
|
||||
$("#editProfilePopupWrapper .edit-profile-submit").on("click", async () => {
|
||||
$("#editProfilePopupWrapper #editProfilePopup").on("submit", async (e) => {
|
||||
e.preventDefault();
|
||||
await updateProfile();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1126,8 +1126,8 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div id="editProfilePopupWrapper" class="popupWrapper hidden">
|
||||
<div id="editProfilePopup">
|
||||
<div id="editProfilePopupWrapper" class="popupWrapper hidden" tabindex="-1">
|
||||
<form id="editProfilePopup">
|
||||
<div class="title">Edit Profile</div>
|
||||
<div>
|
||||
<label>avatar</label>
|
||||
|
|
@ -1166,6 +1166,6 @@
|
|||
<label>badge</label>
|
||||
<div class="badgeSelectionContainer"></div>
|
||||
</div>
|
||||
<div class="button edit-profile-submit">save</div>
|
||||
</div>
|
||||
<button class="edit-profile-submit" type="submit">save</button>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue