Skip to content

formatter info.input is not up-to-date on first typing although value is #535

Description

@mleister97

E.g.:
I select everything in the field and start typing, e.g. "9" --> first time the formatter is running i am getting "9" as value but 0,00€ (i am using german currency parser) in info.input.

Activity

  1. mleister97 commented on Feb 5, 2023

    @mleister97
    Author

    First time:

    value 9
    FormCurrencyInput.tsx:9 info {userTyping: true, input: '0,00 €'}
    

    Second time and following times:

    FormCurrencyInput.tsx:8 value 9
    FormCurrencyInput.tsx:9 info {userTyping: true, input: '9'}
    
  2. nrps9909 commented on Sep 6, 2026

    @nrps9909

    Rechecked the reported first-keystroke behavior on current master 8a45b34167fa0f4769762d02dc2f8c79bb260190 (React 19.2.8). This appears to have been addressed by the already-merged #587.

    I reproduced the setup with an initial 0,00 € display (de-DE / EUR), a German decimal parser, and formatter returning info.input while typing. Replacing the entire field with 9 now gives the first formatter call ['9', { userTyping: true, input: '9' }]; typing a second digit and blurring also preserves the value and reformats it correctly. All four combinations of controlled/uncontrolled and React StrictMode on/off pass.

    For a causal check, removing only the immediate input-ref refresh restores the reported stale input: '0,00 €' in both uncontrolled cases. The existing formatter info should be correct regression also fails under that removal. Restoring the line passes the full suite: 166 existing tests plus the four local reproductions (170 total).

    This evidence covers the component directly; the original custom wrapper code was not included in the report. Validation performed with Codex assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions