fixed some bugs

This commit is contained in:
IM23a-spirgif
2024-09-21 18:55:30 +02:00
parent 9f12490fc7
commit 8a35ac8edd
3 changed files with 13 additions and 12 deletions
+4 -1
View File
@@ -401,7 +401,6 @@ function updateModifiedWeaponStats(damage, rpm, reloadTime) {
`;
}
// Function to filter weapons in the dropdown based on search input
function filterWeapons() {
const input = document.getElementById('weapon-search').value.toLowerCase();
const weaponSelect = document.getElementById('weapon-select');
@@ -426,6 +425,8 @@ function filterWeapons() {
// Automatically select the first visible matching option
if (firstVisibleOption) {
weaponSelect.value = firstVisibleOption.value;
// Manually trigger the 'change' event after auto-selecting the first option
weaponSelect.dispatchEvent(new Event('change'));
}
}
@@ -454,6 +455,8 @@ function filterOperatives() {
// Automatically select the first visible matching option
if (firstVisibleOption) {
operativeSelect.value = firstVisibleOption.value;
// Manually trigger the 'change' event after auto-selecting the first option
operativeSelect.dispatchEvent(new Event('change'));
}
}