Scroll wheel fix again
This commit is contained in:
+19
-1
@@ -502,6 +502,11 @@ function setupEventListeners() {
|
||||
|
||||
const dispenseQuantityInput = document.getElementById('dispenseQuantity');
|
||||
if (dispenseQuantityInput) {
|
||||
// Prevent accidental value changes when users scroll while focused.
|
||||
dispenseQuantityInput.addEventListener('wheel', (event) => {
|
||||
event.preventDefault();
|
||||
}, { passive: false });
|
||||
|
||||
dispenseQuantityInput.addEventListener('input', () => {
|
||||
const mode = getSelectedDispenseMode();
|
||||
if (mode !== 'subunit') {
|
||||
@@ -524,6 +529,14 @@ function setupEventListeners() {
|
||||
});
|
||||
}
|
||||
|
||||
const dispensePackCountInput = document.getElementById('dispensePackCount');
|
||||
if (dispensePackCountInput) {
|
||||
// Prevent accidental value changes when users scroll while focused.
|
||||
dispensePackCountInput.addEventListener('wheel', (event) => {
|
||||
event.preventDefault();
|
||||
}, { passive: false });
|
||||
}
|
||||
|
||||
// Close modal when clicking outside
|
||||
window.addEventListener('click', (e) => {
|
||||
if (e.target.classList.contains('modal')) {
|
||||
@@ -1279,7 +1292,7 @@ function renderDispenseBatchAllocationRows(activeBatches) {
|
||||
: 0;
|
||||
const allocationLabel = mode === 'pack' ? 'Allocate Packs' : 'Allocate';
|
||||
const allocationMax = mode === 'pack' ? availableFullPacks : getBatchAvailableDispenseQuantity(batch, mode, selectedPack);
|
||||
const allocationStep = mode === 'pack' ? 1 : 0.1;
|
||||
const allocationStep = mode === 'pack' ? '1' : '1.0';
|
||||
const batchAvailabilityNote = mode === 'pack'
|
||||
? (selectedPack && batchMatchesSelectedPack(batch, selectedPack) && availableFullPacks <= 0
|
||||
? 'No full packs available in this batch'
|
||||
@@ -1324,6 +1337,11 @@ function renderDispenseBatchAllocationRows(activeBatches) {
|
||||
}).join('');
|
||||
|
||||
batchInfoContent.querySelectorAll('.dispense-batch-allocation').forEach(input => {
|
||||
// Prevent accidental value changes when users scroll while focused.
|
||||
input.addEventListener('wheel', (event) => {
|
||||
event.preventDefault();
|
||||
}, { passive: false });
|
||||
|
||||
input.addEventListener('input', updateDispenseAllocationSummary);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user