Skip to content
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

fix(dashboard): don't use defaultValues for async content #7187

Merged

Conversation

ChmaraX
Copy link
Contributor

@ChmaraX ChmaraX commented Dec 2, 2024

What changed? Why was the change needed?

Details: https://linear.app/novu/issue/NV-4941/step-form-values-are-not-being-properly-updated-after-revisiting

form_fields_bug.mp4

Copy link

linear bot commented Dec 2, 2024

Comment on lines +66 to +69
defaultValues,
values: {
...defaultValues,
...step.controls.values,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to some posts values should be used for values that depend on async return and defaultValues on static fields, but the react-hook-form docs states various other things, quite confusing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I am not sure I understand the fix. If it works it works but I suggest adding a comment in the code.

Copy link

netlify bot commented Dec 2, 2024

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit 3004b7d
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/674dcba54f07db0008575d45
😎 Deploy Preview https://deploy-preview-7187.dashboard.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 2, 2024

Deploy Preview for novu-stg-vite-dashboard-poc ready!

Name Link
🔨 Latest commit 3004b7d
🔍 Latest deploy log https://app.netlify.com/sites/novu-stg-vite-dashboard-poc/deploys/674dcba5fdcc000008e00b6d
😎 Deploy Preview https://deploy-preview-7187.dashboard-v2.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 2, 2024

Deploy Preview for dashboard-v2-novu-staging ready!

Name Link
🔨 Latest commit 3004b7d
🔍 Latest deploy log https://app.netlify.com/sites/dashboard-v2-novu-staging/deploys/674dcba55c760900085e338f
😎 Deploy Preview https://deploy-preview-7187--dashboard-v2-novu-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment on lines +66 to +69
defaultValues,
values: {
...defaultValues,
...step.controls.values,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I am not sure I understand the fix. If it works it works but I suggest adding a comment in the code.

@ChmaraX ChmaraX merged commit 45f77c0 into next Dec 3, 2024
40 checks passed
@ChmaraX ChmaraX deleted the nv-4941-step-form-values-are-not-being-properly-updated-after branch December 3, 2024 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants