Skip to content

Commit

Permalink
Workaround for changetracking issue (adrhumphreys#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
kinglozzer committed Jul 15, 2021
1 parent f6269b5 commit 2a5536a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions client/src/legacy/entwine/TextDropdownField.entwine.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jQuery.entwine('ss', ($) => {
const Component = loadComponent('TextDropdownField');
const schemaState = this.data('state');

const form = this.closest('.cms-edit-form');
form.changetracker('destroy');

const setValue = (fieldName, value) => {
const input = document.querySelector(`input[name="${fieldName}"]`);

Expand All @@ -20,6 +23,8 @@ jQuery.entwine('ss', ($) => {
};

ReactDOM.render(<Component {...schemaState} onAutofill={setValue} />, this[0]);

form.changetracker(form.getChangeTrackerOptions());
},

onunmatch() {
Expand Down

0 comments on commit 2a5536a

Please sign in to comment.