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

Having a Hyper field in a Matrix field creates constant "Showing your unsaved changes" message #189

Open
sjcallender opened this issue Aug 30, 2024 · 9 comments

Comments

@sjcallender
Copy link

sjcallender commented Aug 30, 2024

Describe the bug

Even with CRAFT_AUTOSAVE_DRAFTS=false, our Hyper fields within Matrix fields create drafts, but only when using Firefox (Mac). We can never escape the "Showing your unsaved changes" message.

Steps to reproduce

  1. Add a Hyper field to a Matrix field block and assign it an entry type of your choice.
  2. In Firefox, visit an entry where you can add content to the Hyper field, save it.
  3. Refresh and note the "Showing your unsaved changes" message.
  4. Click "Discard" and note the "Showing your unsaved changes" message reappears.

Craft CMS version

6.3.5

Plugin version

2.0.4

Multi-site?

No

Additional context

CleanShot 2024-08-30 at 10 52 49

@engram-design
Copy link
Member

I can't seem to replicate this in any browser I'm afraid, and I've replicated your field setup of nested Matrix fields. Certainly seems like a race condition based on the loading "flash" when you reload the page.

@stereomyth
Copy link

This has also happened to me in Chrome with a sufficiently complicated Neo field containing or next to a Hyper field. It stops happening if I disable the timeout added to updateInitialSerializedValue to fix Vizy compatibility. It does seem like a race condition during initialisation of different JS enhanced fields.

@sjcallender
Copy link
Author

Good find, @stereomyth.

@engram-design, would allowing us to set the timeout value for updateInitialSerializedValue be a reasonable option? Maybe we need to set ours at 1000, for example.

@engram-design
Copy link
Member

engram-design commented Sep 4, 2024

Just pushing some revised changes to address this. To get this early, run composer require verbb/hyper:"dev-craft-5 as 2.0.4". I'd love to see if that rectifies this.

@daveguillory
Copy link

Just pushing some revised changes to address this. To get this early, run composer require verbb/hyper:"dev-craft-5 as 2.0.4". I'd love to see if that rectifies this.

@engram-design I went ahead and updated to this on a local dev site, and I'm still getting the issue. It happens immediately after the page reloads from saving.

image

@engram-design
Copy link
Member

Thanks for letting me know @daveguillory. Sorry to be a pain, but can you replicate this with as minimal example as possible? Ideally with just the Hyper field, and maybe even disabling every other non-critical plugin. I'm struggling to reproduce these even after manually adding unrealistic timeout values to simulate race conditions.

@elfacht
Copy link

elfacht commented Sep 11, 2024

I am having the same issue with nested fields in Neo and it happens as soon I am entering an entry without any actions. Unfortunately the dev release doesn't fix it.

@elfacht
Copy link

elfacht commented Sep 11, 2024

Maybe this helps: we are running Craft 5.2.10 on production and are not facing this issue, but on the test system with Craft 5.4.2. In the meantime something may have changed in Craft causing this?

In 5.3.0 these changes came up:

  • Front-end queue runner scripts are now injected before the tag, rather than at the end of the response HTML.

Maybe this could cause the race condition?

@smockensturm
Copy link

Same exact issue. Extremely annoying behavior.

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

No branches or pull requests

6 participants