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

Mod component shows as unsaved/dirty after clearing changes #9355

Closed
twschiller opened this issue Oct 25, 2024 · 1 comment · Fixed by #9361
Closed

Mod component shows as unsaved/dirty after clearing changes #9355

twschiller opened this issue Oct 25, 2024 · 1 comment · Fixed by #9361
Assignees

Comments

@twschiller
Copy link
Contributor

twschiller commented Oct 25, 2024

Describe the bug

To Reproduce

Steps to Reproduce:

  1. For an activated mod
  2. Change the name of a mod component in the Page Editor
  3. Click Clear Changes for the mod component

Actual behavior

The changes are cleared in the form state, but the component still shows a red disk icon

Expected behavior

The component does not show a red disk icon

Discussion

  • From the UI it looks like the mod component might be getting correctly set at clean and then getting marked as dirty
    • If you click Clear Changes on the mod and then click into the mod components, they also get marked as dirty. So I suspect for these mods there’s some useEffect normalization causing them to become dirty
  • If the editor is performing useEffects to normalize the state this is potentially the "correct" behavior in that the brick is being modified (although non-functionally) when the user clicks into it

Desktop (please complete the following information):

  • Extension Version: 2.1.6-beta.1

Related Code

@twschiller
Copy link
Contributor Author

twschiller commented Oct 26, 2024

It's unclear how/why Formik is setting the form state (logs from turning on redux loggers diff feature):

image

This could be related to reinitializing the form instead of remounting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant