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

ChosenFolderID field triggers changetracker in Chrome #39

Open
sig-peggy opened this issue Mar 5, 2023 · 0 comments
Open

ChosenFolderID field triggers changetracker in Chrome #39

sig-peggy opened this issue Mar 5, 2023 · 0 comments

Comments

@sig-peggy
Copy link

Summary

The 'DocumentConversionSettings-ChosenFolderID' field is causing the silverstripe/admin jquery.changetracker.js to mark the page as changed when there are no changes in Chrome. This does not happen in Firefox.

Versions

silverstripe/documentconverter: 2.3.0
silverstripe/admin: 1.11.3
Chrome: Version 110.0.5481.178
PHP: 8.1

Details

In Chrome, the changetracker records the initial value of the field as:
{"name":"DocumentConversionSettings-ChosenFolderID","value":""}
After the TreeDropdownField finishes loading this changes to:
{"name":"DocumentConversionSettings-ChosenFolderID","value":"0"}

The no-change-track class is added to the field holder <div> for this field but is not on the actual <input> field, which is where the changetracker is looking for that class:

<div class="Select treedropdownfield treedropdown single no-change-track searchable has-value is-clearable is-searchable Select--single">
<input name="DocumentConversionSettings-ChosenFolderID" type="hidden" value="0"><div class="Select-control">

This is therefore appearing as a changed field, causing the save/publish buttons to become active and triggering the browser warning that changes will be lost when the user tries to navigate away from the page even when no changes have been made.

In Firefox, the field value starts as "value":"0" and therefore does not trigger this issue.

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

No branches or pull requests

2 participants