소스 검색

fix handling of non-decimal chars in FloatEdit fields

Daniel Sheffield 3 년 전
부모
커밋
b346e7dc44
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      grocery_transactions.py

+ 4 - 1
grocery_transactions.py

@@ -200,8 +200,11 @@ class AutoCompleteFloatEdit(numedit.FloatEdit):
         elif key in ('=', 'enter',):
             self.calc()
             return
-        else:
+        elif key in ('esc', 'left', 'right', 'up', 'down',) or \
+             key in '0123456789.':
             return super(AutoCompleteFloatEdit, self).keypress(size, key)
+        else:
+            return
 
 
 class GroceryTransactionEditor(urwid.WidgetPlaceholder):