Skip to content

Commit

Permalink
Merge pull request #232 from Jinntec/feature/fix-race
Browse files Browse the repository at this point in the history
Fix race with sub-fores
  • Loading branch information
JoernT authored Oct 19, 2023
2 parents f7faa14 + 733254f commit 02f2472
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ui/fx-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,12 @@ export default class FxControl extends XfAbstractControl {
'model-construct-done',
e => {
const defaultInst = imported.querySelector('fx-instance');
if (this.initialNode) {
if (this.initial) {
const doc = new DOMParser().parseFromString('<data></data>', 'application/xml');
// Note: Clone the input to prevent the inner fore from editing the outer node
// Also update the `initialNode` to make sure we have an up-to-date version
this.initialNode = evaluateXPathToFirstNode(this.initial, this.nodeset, this);

doc.firstElementChild.appendChild(this.initialNode.cloneNode(true));
defaultInst.setInstanceData(doc);
}
Expand Down

0 comments on commit 02f2472

Please sign in to comment.