Giter Site home page Giter Site logo

Comments (7)

s-yadav avatar s-yadav commented on July 26, 2024

from react-number-format.

mquandalle avatar mquandalle commented on July 26, 2024

Well actually on second though, I would say that the expected behavior is to delete a digit every time Detete or Backspace is pressed, like so:

Current State Key pressed Expected
`USD 1 ,500` Backspace
`USD 1, 500` Backspace
`USD 500` Backspace
`USD 1 ,500` Delete
`USD 1, 500` Delete

This could be implemented by registering an handler onKeyDown to handle event.keyCode 8 (for Backspace) and 46 (for Delete).

What do you think @s-yadav?

from react-number-format.

s-yadav avatar s-yadav commented on July 26, 2024

Yes I have done the same fix. Will push it with some other changes.

from react-number-format.

s-yadav avatar s-yadav commented on July 26, 2024

Somehow I feel, it's better to have your first case (that is just changing the cursor position). The second case seems visually wrong and confuses (at least to me).

from react-number-format.

s-yadav avatar s-yadav commented on July 26, 2024

@mquandalle Can you cross check version 1.1.0-alpha or branch 1.1.0-alpha.

from react-number-format.

mquandalle avatar mquandalle commented on July 26, 2024

Version 1.1.0-alpha looks good to me (I've just read to code, not tested yet).

About my second suggestion, maybe this could be an option? At least in French, when the group delimiter is a blank space, moving the cursors doesn't make much sense.

from react-number-format.

s-yadav avatar s-yadav commented on July 26, 2024

Moving cursor does not feel very odd, but deleting a character not near to cursor feels odd, mainly when doing backspace, and behaviour of backspace and delete should be same just on other direction.
Lets keep the first case. Anyway as long user is able to delete we are ok.

from react-number-format.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.