aurelia / aurelia/templating

ViewFactory does not invalidate cache after the factories template changed

Open
#595 24 comments 0 reactions 1 assignee Claimed by @bigopon View on GitHub
enhancement
Dominant language
TypeScript
Stars
113
Forks
101
PR merge metrics
No merged PRs in 30d

Description

**I'm submitting a bug report**

* **Library Version:**
1.7.0

**Please tell us about your environment:**
* **Operating System:**
Windows 10

* **Node Version:**
6.10.2

* **NPM Version:**
5.3.0

* **JSPM OR Webpack AND Version**
JSPM 0.16.53

* **Browser:**
all

* **Language:**
all

**Current behavior:**
Using custom elements in multiple repeats with view-cache enabled causes weird behaviour when different templates are used for each repeat and items are moved from one repeat to the other one.
I guess the fragment of the cached view is not updated when the element was moved from one repeat to another.

This bug first occurred when I was using the [oribella-aurelia-sortable](https://github.com/oribella/aurelia-sortable) library that uses a repeat with enabled cache to ensure touch-support is working correctly (see furthermore [here](https://github.com/aurelia/templating-resources/issues/209) and [here](https://github.com/oribella/aurelia-sortable/issues/44)).

**Expected/desired behavior:**
For an example for both expected and current behaviour and how to reproduce please see here: https://gist.run/?id=2cd8a03e16f92ce64308f9ec841c3b70

* **What is the expected behavior?**
We could invalidate the cache when the template of the ViewFactory has changed so the ViewFactory is forced to re-create the view, but I am not sure if the will break touch-support yet again.

* **What is the motivation / use case for changing the behavior?**
To ensure the oribella-aurelia-sortable library can be used with touch support.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.