Bugzilla – Attachment 190352 Details for
Bug 41408
POS Inline Editing Triggers Form Submission on Enter Key
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41408: Added e.preventDefault() and e.stopPropagation() to edit
94aaeae.patch (text/plain), 1.87 KB, created by
Martin Renvoize (ashimema)
on 2025-12-09 15:55:43 UTC
(
hide
)
Description:
Bug 41408: Added e.preventDefault() and e.stopPropagation() to edit
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-12-09 15:55:43 UTC
Size:
1.87 KB
patch
obsolete
>From 94aaeae2523b57f96db4522ba2875cdd5a7f3e29 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Tue, 9 Dec 2025 15:39:49 +0000 >Subject: [PATCH] Bug 41408: Added e.preventDefault() and e.stopPropagation() > to edit > >Prevent inline editing in POS for the cost and quantity fields from submitting the form on 'Enter'. > >Test plan: >1. Ensure the POS page is accessible (Set UsePointOfSale, add a Cash > Register and some Debit types for sale) >2. Navigate to the Point of Sale page (pos/pay.pl) >3. Add an item to the "This sale" table >4. Click on the "Cost" cell to edit the price inline >5. Change the value and press Enter >6. Expected: The cell value should update without submitting the form >7. Try editing the "Quantity" field as well (same fix applies) >8. Complete a normal transaction to ensure form submission still works with the submit button >--- > koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >index ee7251f9c6f..4e0da24182c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >@@ -423,8 +423,12 @@ > > // Handle blur and Enter key events > input.addEventListener('blur', updateCell); >- input.addEventListener('keyup', function(e) { >- if (e.key === 'Enter') updateCell(); >+ input.addEventListener('keydown', function(e) { >+ if (e.key === 'Enter') { >+ e.preventDefault(); >+ e.stopPropagation(); >+ updateCell(); >+ } > }); > > function updateCell() { >-- >2.52.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41408
:
190352
|
190486