I'm using this javascript event.
myDatepicker.addEventListener('dateChange.mdb.datepicker', (e) => {
var params = new URLSearchParams(location.search);
params.set('date', Datepicker1.value.replaceAll('/', "-"));
window.location.hash = 'graph';
window.location.search = params.toString();
});
In chrome everything is working as expected.
In firefox the event doesn't wait for the page to be rendered so it doesn't scroll to the right place. However if I press enter on the url after the event or enter the url manually, it is working as expected.
How can I force firefox to wait until the page rendering is complete?
Max
ps: What I tried following barmar comment with the same result
redirect = (e) => {
var params = new URLSearchParams(location.search);
params.set('date', Datepicker1.value.replaceAll('/', "-"));
window.location.hash = 'graph';
window.location.search = params.toString();
};
myDatepicker.addEventListener('dateChange.mdb.datepicker', redirect);
document.addEventListener('load', redirect);
ps2: It seem to be the intended comportment with the reloading of firefox not deleting some elements from the cache that other browser do.