-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash caused by ui-widget alt-datetime when using "Now" button and making changes #3516
Closed
4 tasks done
Labels
Comments
MatinF
added
bug
needs triage
Initial label given, to be assigned correct labels and assigned
labels
Mar 17, 2023
heath-freenome
added a commit
to heath-freenome/react-jsonschema-form
that referenced
this issue
Mar 17, 2023
Fixes rjsf-team#3516 by removing the infinite loop caused by two `useEffects()` by moving the code for one into the `onChange` handler - Updated `AltDateWidget` to switch to a simple `useState()` rather than `useReducer()` and moved the code for one `useEffect()` into the `onChange` handler - This change makes the code match the `antd` and `chakra-ui` versions - Updated the `CHANGELOG.md` accordingly
8 tasks
heath-freenome
added a commit
to heath-freenome/react-jsonschema-form
that referenced
this issue
Mar 19, 2023
Fixes rjsf-team#3516 by removing the infinite loop caused by two `useEffects()` by adding a new state for the `value` and combining the effects into one - Updated `AltDateWidget` to stash the `value` in state and combining the two `useEffects()` into a single effect - The effect will call `onChange()` when the `state` is ready for change AND it causes a different string than the current `value` - If the `lastValue` recorded differs from the `value`, then we record the new `value` and set the `state` to it - Updated the `CHANGELOG.md` accordingly
heath-freenome
added a commit
to heath-freenome/react-jsonschema-form
that referenced
this issue
Mar 19, 2023
Fixes rjsf-team#3516 by removing the infinite loop caused by two `useEffects()` by adding a new state for the `value` and combining the effects into one - Updated `AltDateWidget` to stash the `value` in state and combining the two `useEffects()` into a single effect - The effect will call `onChange()` when the `state` is ready for change AND it causes a different string than the current `value` - If the `lastValue` recorded differs from the `value`, then we record the new `value` and set the `state` to it - Updated the `CHANGELOG.md` accordingly
heath-freenome
added a commit
that referenced
this issue
Mar 19, 2023
Fixes #3516 by removing the infinite loop caused by two `useEffects()` by adding a new state for the `value` and combining the effects into one - Updated `AltDateWidget` to stash the `value` in state and combining the two `useEffects()` into a single effect - The effect will call `onChange()` when the `state` is ready for change AND it causes a different string than the current `value` - If the `lastValue` recorded differs from the `value`, then we record the new `value` and set the `state` to it - Updated the `CHANGELOG.md` accordingly
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Prerequisites
What theme are you using?
core
Version
5.3
Current Behavior
Browser crashes when trying to use the ui-widget
alt-datetime
in Live Playground (Chrome browser).Expected Behavior
The expected behavior is that the form data would update in response to the change in the date time dropdowns
Steps To Reproduce
alt-datetime
widget to get the current date & time by clicking the "Now" buttonEnvironment
- OS: Windows 10 (Live Playground)
Anything else?
No response
The text was updated successfully, but these errors were encountered: