Skip to content

@react-stately/numberfield Controlled Value Bug #3480

Closed
@callen1994

Description

@callen1994

🐛 Bug Report

When using a controlled value on a component that uses a "useNumberFieldState" hook, the component will hold a state value that is out of sync with the parent. On blur the emitted value will be different from the stored value. Also the value will toggle between two previous values when you focus and un-focus the element.

🤔 Expected Behavior

The State within the component should reflect what's displayed on the input element. The value shouldn't revert back to a previous value when on-blur.

😯 Current Behavior

This code sandbox displays the bug effectively.
https://codesandbox.io/s/8iddiw

💁 Possible Solution

When I installed @react-stately/numberfield @3.0.0 the bug stopped showing up

🔦 Context

I'm trying to use React ARIA to build a library of styled input components.

💻 Code Sample

This code sandbox displays the bug effectively.
https://codesandbox.io/s/8iddiw

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