smooth things out
This commit is contained in:
@@ -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
Reference in New Issue
Block a user