Skip to content

Commit

Permalink
changed deapthInput in filtration
Browse files Browse the repository at this point in the history
  • Loading branch information
Olesya-Khulap committed Dec 1, 2024
1 parent bc731dd commit cc4ad76
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,15 @@ document.addEventListener("DOMContentLoaded", () => {
});

depthInput.addEventListener("input", () => {
// Проверка, чтобы значение было в допустимых пределах
if (depthInput.value < depthRange.min) {
depthInput.value = depthRange.min;
} else if (depthInput.value > depthRange.max) {
depthInput.value = depthRange.max;
}
depthRange.value = depthInput.value;
});
let value = parseInt(depthInput.value, 10) || 0; // Преобразуем значение в целое число
if (value < depthRange.min) {
value = parseInt(depthRange.min, 10);
} else if (value > depthRange.max) {
value = parseInt(depthRange.max, 10);
}
depthInput.value = value; // Обновляем input
depthRange.value = value; // Синхронизируем с range
});

// Обработчик для синхронизации значения площади (range и input)
areaRange.addEventListener("input", () => {
Expand Down

0 comments on commit cc4ad76

Please sign in to comment.