Tangerine-Community / tangy-form

<tangy-form> is a web component for creating multipage forms. Other <tangy-*> input elements are included as well.
GNU General Public License v3.0
15 stars 3 forks source link

Dynamically evaluate directives on tangy-template on complete responses #312

Closed rjcorwin closed 2 years ago

rjcorwin commented 2 years ago

When viewing a completed form response, all tangy-templates now appear regardless of any previously evaluated directive because state like skipped has not been saved in form responses. This PR makes tangy-template even more dynamic by evaluating directives on tangy-template even when in a completed form response.

Trade offs

An alternative approach would be to save the tangy-template's state in the form response like we do with everything else. The downside of this approach is tangy-templates can get quite large can balloon form response sizes. For consistency sake though and predictable behavior, saving the state would be a win. We should consider a new tangy-template-2 (or other name) element that would save state so that form developers can choose which trade-off makes sense for which tangy template.