Skip to content

Commit

Permalink
Do not reload page when pressing enter on search/filter
Browse files Browse the repository at this point in the history
Also do not hide loading on login/signup before data is fully loaded.
  • Loading branch information
BrunoBernardino committed Nov 3, 2023
1 parent ce3a5dc commit c466ed0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions public/ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ document.addEventListener('app-loaded', async () => {
const loginButton = document.getElementById('login-button') as HTMLButtonElement;
const signupButton = document.getElementById('signup-button') as HTMLButtonElement;

const expensesFilterForm = document.getElementById('expenses-filter') as HTMLFormElement;
const expensesFilterSearchInput = document.getElementById('expenses-filter-search') as HTMLInputElement;
const budgetsFilterButton = document.getElementById('budgets-filter-button') as HTMLButtonElement;
const addBudgetButton = document.getElementById('add-budget-button') as HTMLButtonElement;
Expand Down Expand Up @@ -97,8 +98,6 @@ document.addEventListener('app-loaded', async () => {
}
}

window.app.hideLoading();

isLoggingInOrSigningUp = false;
}

Expand Down Expand Up @@ -773,6 +772,11 @@ document.addEventListener('app-loaded', async () => {

loginForm.addEventListener('submit', login);
signupButton.addEventListener('click', signup);
expensesFilterForm.addEventListener('submit', (event) => {
event.preventDefault();
event.stopPropagation();
showData();
});
addExpenseForm.addEventListener('submit', addExpense);
addBudgetButton.addEventListener('click', showAddBudgetModal);
budgetsFilterButton.addEventListener('click', showBudgetsFilterModal);
Expand Down

0 comments on commit c466ed0

Please sign in to comment.