Coder Social home page Coder Social logo

Comments (4)

Sunilverma99 avatar Sunilverma99 commented on July 27, 2024 1

#29862
The issue arises because the useEffect hook depends on both value1 and value2, causing the value not to update properly. By removing the dependencies on value1 and value2, the component functions correctly.
Screenshot 2024-06-13 114347
Screenshot 2024-06-13 114318

from react.

Musaeeb-Zahir avatar Musaeeb-Zahir commented on July 27, 2024

Hi

from react.

BrendonSled avatar BrendonSled commented on July 27, 2024

@Sunilverma99 you're inspecting the wrong values there. This issue is specifically around the defaultValue that is set so when a form is reset the values are not correct. If you inspect the element you can get a better example of what is happening here. All other input types will have the html attributes change except type=number

Screenshot 2024-06-11 at 1 01 17 PM

from react.

BrendonSled avatar BrendonSled commented on July 27, 2024

https://codesandbox.io/p/github/BrendonSled/react-19-controlled-input-number-bug/new-example

This might be a better example of the exact issue I'm facing. If you input hit the enter key while focused in the number input the field value will be erased on the form submit even though the state is still the old value.

from react.

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.