p5.js-web-editor
p5.js-web-editor copied to clipboard
Fixes form reinitialization on language change (#3229)
Fixes #3229
Changes:
- Introduced a
formUpdateKey
state to force form reinitialization - Added useEffect hook to update
formUpdateKey
when language changes - Set
formUpdateKey
as thekey
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