p5.js-web-editor icon indicating copy to clipboard operation
p5.js-web-editor copied to clipboard

Fixes form reinitialization on language change (#3229)

Open AbhigyanSrivastav opened this issue 4 months ago • 0 comments

Fixes #3229

Changes:

  • Introduced a formUpdateKey state to force form reinitialization
  • Added useEffect hook to update formUpdateKey when language changes
  • Set formUpdateKey as the key prop for the Form component to ensure remount

This change ensures that the form reinitializes properly when the language is switched, even if error messages were displayed in the previous language.

I have verified that this pull request:

  • [x] has no linting errors (npm run lint)
  • [x] has no test errors (npm run test)
  • [x] is from a uniquely-named feature branch and is up to date with the develop branch.
  • [x] is descriptively named and links to an issue number, i.e. Fixes #3229

AbhigyanSrivastav avatar Oct 16 '24 09:10 AbhigyanSrivastav