From 00ffd3ec13e3c4796156df44a5f8a62743cb2999 Mon Sep 17 00:00:00 2001 From: charukiewicz Date: Mon, 3 May 2021 02:02:54 -0500 Subject: [PATCH] web: fix a bug with keypress listener on the final amount input in AddForm not getting initialized correctly --- hledger-web/static/hledger.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hledger-web/static/hledger.js b/hledger-web/static/hledger.js index 824de62bb..40771829c 100644 --- a/hledger-web/static/hledger.js +++ b/hledger-web/static/hledger.js @@ -23,6 +23,12 @@ $(document).ready(function() { dateEl.datepicker('hide'); }); + // ensure that the keypress listener on the final amount input is always active + $('#addform') + .on('focus', '.amount-input:last', function() { + addformLastAmountBindKey(); + }); + // keyboard shortcuts // 'body' seems to hold focus better than document in FF $('body').bind('keydown', 'h', function(){ $('#helpmodal').modal('toggle'); return false; });