fix(loyalty): restrict earn points input to digits and decimal only
Some checks failed
CI / ruff (push) Successful in 16s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled

Add keypress filter to block non-numeric characters (e, +, -) and
inputmode="decimal" for mobile keyboard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-26 16:11:10 +02:00
parent 56c94ac2f4
commit 143248ff0f

View File

@@ -212,8 +212,9 @@
<label class="block text-xs text-gray-500 dark:text-gray-400 mb-1">{{ _('loyalty.store.terminal.purchase_amount') }}</label> <label class="block text-xs text-gray-500 dark:text-gray-400 mb-1">{{ _('loyalty.store.terminal.purchase_amount') }}</label>
<div class="relative"> <div class="relative">
<span class="absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500">EUR</span> <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500">EUR</span>
<input type="number" step="0.01" min="0" {# noqa: FE-008 #} <input type="number" step="0.01" min="0" inputmode="decimal" {# noqa: FE-008 #}
x-model.number="earnAmount" x-model.number="earnAmount"
@keypress="if (!/[\d.]/.test($event.key) && $event.key !== 'Backspace' && $event.key !== 'Tab') $event.preventDefault()"
class="w-full pl-12 pr-4 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg focus:border-green-400 focus:outline-none dark:bg-gray-700 dark:text-gray-300"> class="w-full pl-12 pr-4 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg focus:border-green-400 focus:outline-none dark:bg-gray-700 dark:text-gray-300">
</div> </div>
</div> </div>