Typing "-" in a cell is silently dropped: "500-120" is saved as 500120
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- frontend, testing-qa
Research direction
Start with src/app/components/base/currency-cell/CurrencyCell.vue and inspect the keydown handler that blocks -. Run the “Evaluate expressions correctly” scenario in test/budgets.spec.ts, changing keyboard input to pressSequentially() to reproduce the real interaction. Done means typing 500-120 evaluates to 380 or is marked invalid, with a regression test covering keyboard entry.
Written by the indexing model from the issue text.
Description
I've found a bug and checked that ...
- ...there are no open or closed issues that are related to my problem
- ...it's definitely a bug and not a feature request
Description
The expression evaluator supports subtraction, but CurrencyCell.vue calls preventDefault() on every - keydown. When a user types 500-120 on the keyboard, the minus is swallowed and the cell silently stores 500120 instead of 380. The input is not marked invalid, so the wrong amount goes unnoticed. Pasting 500-120 works correctly (380).
Related but different: #165 (allow negative numbers) and #144 (subtract in cells). This issue is about silent data corruption, not about the feature.
Environment
- Browser: Chromium-based
- OS: Windows 10
- Ocular version:
mainat 3cb23f7 (2026-09-05),pnpm dev
Expected behaviour
Either 500-120 evaluates to 380, or the cell is marked invalid. It should never store a different number than the one the user typed.
Steps to reproduce
- Open Income and click any cell.
- Type
500-120on the keyboard, then press Enter or click outside. - The cell shows
500,120instead of380.
Additional info
- Cause:
src/app/components/base/currency-cell/CurrencyCell.vue, thekeydownhandler blocks-unconditionally. - The e2e test "Evaluate expressions correctly" (
test/budgets.spec.ts) fills500 - 50withfill(). That sets the value directly and never fireskeydown, so the test passes while real keyboard input fails. UsingpressSequentially()reproduces the bug. - Possible fix: allow
-everywhere except the first character, or drop the keydown block and let validation reject negative results. Also switch that test topressSequentially().
- Dominant language
- Vue
- Stars
- 565
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from simonwep/ocular
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 50/100
-
PDF / print Openfeature
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
feature
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
feature
Difficulty 5/5 Over a week Newbie friendliness 35/100
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
bug ready-for-dev
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 92/100