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

A simple click on anything in a Vizy field triggers a draft #334

Open
mattbloomfield opened this issue Feb 28, 2025 · 1 comment
Open

A simple click on anything in a Vizy field triggers a draft #334

mattbloomfield opened this issue Feb 28, 2025 · 1 comment

Comments

@mattbloomfield
Copy link

Describe the bug

If you click a Vizy, even if it's not an input field, it triggers a draft.

It seems to not be able to identify that nothing has changed.

If I save the page then it doesn't happen anymore... for a while? But it does come back and I'm not sure why.

Video: https://www.youtube.com/watch?v=MhVllbjxwbY

Steps to reproduce

  1. Load a page
  2. Click the vizy field
  3. Note that a change has been detected and a draft has been created

Craft CMS version

Craft Pro 4.13.3

Plugin version

2.1.24

Multi-site?

NO

Additional context

Image
@engram-design
Copy link
Member

engram-design commented Mar 3, 2025

This is kind of a known issue with Vizy, and it mostly comes down to how content (which is JSON) can differ compared to it coming from PHP into JS. We do try and mitigate this a little by having a change-detection flag that ensure that the Vizy field doesn't listen to anything changed until you click on it (as you've discovered).

It really depends on how complex your Vizy fields are as well. Nested Vizy fields with complex Craft-based fields like Matrix almost always have an issue when handling JSON-provided data, as their jQuery JS kicks in and starts making changes. This is also another related issue, where Tiptap (Vue) needs to play nicely with all the other fields out there, most of which Craft core ones use jQuery.

We did actually address this similar issue for Hyper lately. For example, just having something like:

{ "some-value: "3" }

In PHP, will be changed to:

{ "some-value: 3 }

In JS, particularly for Element fields, through their own JS, is enough to trigger a change has been made. In the linked Hyper commit, that's just one of the scenarios we deal with.

So while I'm happy to look at this specifically (I'll just need an example of your Vizy field setup and content), it's a somewhat issue that doesn't have a solution right now!

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

2 participants