smooth things out

This commit is contained in:
prospect
2024-01-19 09:59:59 -05:00
parent c2cc79ec8d
commit ca3e82c3d1
2 changed files with 4 additions and 8 deletions

View File

@@ -161,13 +161,6 @@ class PageTransitions {
}).catch(error => console.error('Error fetching content:', error));
}
submitFormAsync(form) {
// Close the mobile keyboard
const searchInput = document.getElementById('s');
searchInput.blur(); // Unfocus the input field to close the keyboard
// Clear the search form
form.reset(); // Reset the form to clear input values
const formData = new FormData(form);
fetch(form.action, {
method: 'POST',
@@ -177,6 +170,9 @@ class PageTransitions {
const targetUrl = form.action; // You might need to adjust this based on your server's response
const elementId = 'content-container';
// Clear the search form
form.reset(); // Reset the form to clear input values
// Update content, push state, and remove transition class
this.updateContent(data, elementId);
history.pushState(null, null, targetUrl);

File diff suppressed because one or more lines are too long