Jinntec / Fore

Fore - declarative user interfaces in plain HTML
MIT License
82 stars 11 forks source link

fx-load only evaluates the URL once #229

Closed JoernT closed 1 year ago

JoernT commented 1 year ago

fx-load with a dynamic expression for the URL like

<fx-load url="templates/pages/annotation/{instance()/type}-editor.html" attach-to="#authority-editor"></fx-load>

only evaluates the expression once as it is directly replaced and next run won't do anything any more.

The issue goes deeper as fx-load is using the evaluateAttributeTemplateExpression function from ForeElementMixin. This function is destructive in the sense as not being re-entrant. Instead these template expressions should be handled by the global mechanism in fx-fore. We have more cases of 'local' evaluations in submission, message ...?

JoernT commented 1 year ago

was a quick fix ;) - wrongly overwriting the attribute instead of evaluating and using the result