Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions front-end/views/profile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ function profileView(username) {
createLogin
);
document
.querySelector("[data-action='login']")
?.addEventListener("click", handleLogin);

.querySelector("[data-form='login']")//data-action triggers a certain behavior and data-form = login is a component identity for loginform
?.addEventListener("submit", handleLogin); //js listen to a submit event on the form not a click event.
const profileData = state.profiles.find((p) => p.username === username);
if (profileData) {
renderOne(
Expand Down