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

Changetracker fired on load #11

Open
kinglozzer opened this issue Jul 15, 2021 · 3 comments · May be fixed by #20
Open

Changetracker fired on load #11

kinglozzer opened this issue Jul 15, 2021 · 3 comments · May be fixed by #20

Comments

@kinglozzer
Copy link

kinglozzer commented Jul 15, 2021

I can’t for the life of me figure out why, but the change tracker marks the page as “dirty” on load if using this on non-inline-editable content blocks.

I’ve tried adding no-change-track to all the form inputs, but to no avail 😢

For now I’m working around this by destroying the change tracker and re-initialising it: bigfork@2a5536a. It’s ugly, but it works 😅

kinglozzer added a commit to bigfork/silverstripe-textdropdownfield that referenced this issue Jul 15, 2021
@michalkleiner
Copy link

We might be seeing something similar on one of our sites and we don't use this field, so it might be caused by something else.

@adrhumphreys
Copy link
Owner

Interesting, could it be something from a recent change in one of core repos? I'm running this on v4.7.3 currently so wondering if it might be a 4.8 thing?

@kinglozzer
Copy link
Author

I don’t think anything’s changed with changetracking (https://github.com/silverstripe/silverstripe-admin/commits/1/thirdparty/jquery-changetracker), and if I remove the field entirely the issue goes away too so I’m pretty sure it’s something to do with this.

It seems to happen when the react component replaces the standard input, I wonder if it may be something as simple as the name/value being slightly different once the field is react-rendered, and that’s causing the serialized value of the form to change and trigger the changetracker: https://github.com/silverstripe/silverstripe-admin/blob/d3fc48cde0aef36518d0b7efd11dd5711bef6be4/thirdparty/jquery-changetracker/lib/jquery.changetracker.js#L99-L114

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 a pull request may close this issue.

3 participants