TrySound / TrySound/rifm

Cursor position when deleting last number before seperator

Open
#116 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.4k
Forks
37
Avg merge
2h 19m
Merged PRs (30d)
11

Description

Hey guys,

We are using rifm for input fields where the value of the input should be a number with a two digit fractional part

We're having some issues when deleting the last number before the decimal seperator.

The issue:
Let's assume the value of the field to be |5.23 and the cursor position is marked as '|'
If the user press delete the input field will display |0.23
If the user now press a number i.e. 6 the field will display 6|0.23

This is an issue because the user will assume that the field display 6|.23 and not 6|0.23

You can reproduce the behaivor in rifm's demo sandbox. I also made an isolated sandbox here:
https://codesandbox.io/s/async-hill-r1hpx?file=/index.js

Are we missing some configuration to avoid this behaivor or is it an edge case?

Cheers from Norway,
Simon

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the deletion sequence in rifm's demo sandbox and the isolated CodeSandbox entry point at index.js. Check how the input and cursor behave when deleting the last integer digit before the decimal separator, then determine whether the expected behavior requires configuration or a code change; done means the reported sequence produces the intended cursor and value behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.