Skip to content

Conversation

@jankapunkt
Copy link
Collaborator

@jankapunkt jankapunkt commented Jul 4, 2019

The insertConfig is deleted in line 56:

delete this.data.atts.insertConfig;

but there is the case that it is still present or "reassigned" by autoform (the reactivity makes properties reappear, I think) and this comes when the template re-renders but the onCreated has been only called once, so the insertConfig is not stripped again.

It is then later assigned to the input atts at

<input value="{{fileId}}" type="hidden" {{this.atts}}>

So I thought before messing with the whole reactivitity and break the whole package we just "clean" the atts using a helper when the template is drawn:

<input value="{{fileId}}" type="hidden" {{inputAtts this}}>
 inputAtts(formContext) {
    const { atts } = formContext;
    if (!atts) return;
    delete atts.insertConfig;
    return atts;
  }

Runs fine now on my side with any insert config. Can someone please confirm?

@dr-dimitru
Copy link
Member

lgtm! Thank you @jankapunkt

@dr-dimitru dr-dimitru merged commit 823bb12 into master Jul 4, 2019
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 this pull request may close these issues.

3 participants