Weird behaviour (reference not cleaned up) with slots and validation
I'm submitting a bug report
- Library Version: I'm using the current skeleton-typescript-webpack - aurelia-framework 1.1.4
Please tell us about your environment:
-
Operating System: Windows 7
-
Node Version: 6.10.2
- NPM Version: 4.4.4
- Aurelia CLI OR JSPM OR Webpack AND Version webpack 3.3.0
-
Browser: Chrome 60.0.3112.101 Internet Explorer 11 possibly all?
-
Language: TypeScript 2.4.1
Current behavior: I'll link to a fork of the skeleton project, but basically the behaviour is this:
- add an item to the array
- remove the item from the array
- validate the parent controller
and the layout of the elements is:
- the welcome page has a custom element "abc"
- "abc" just has a single
<slot></slot>in it - inside the
<abc></abc>there is a repeating simple custom element that I called "thing" - inside thing is some basic validated properties
The result of this is that the properties in "thing" are validated, even though there are no elements in the thing array. And hence the validation fails. If I replace <abc></abc> with a <div></div> this behaviour does not occur.
Expected/desired behavior:
I would expect that the same thing happens with a slot as without it. It seems as though something in the slot is holding on to a reference of it contents and not letting it get disposed properly.
- What is the motivation / use case for changing the behavior? Hopefully it's clear that this behaviour is inconsistent, if not let me know!
Here's the reproduction: https://github.com/thinkOfaNumber/skeleton-navigation I can trim it down a bit more or turn it into a gist if required.
(I'm going away for 1/2 day so won't be able to reply immediately) thanks for looking into it!
OK here's a working gist showing the odd behaviour: https://gist.run/?id=74d33945221dd5fa6aa01b42d310f097
I can't find a workaround to this, and there's a lot of places we're using slots with validation...
@jdanyow Can you take a look at this?
pinging @jdanyow
gist.run seems to be overwriting my gists when I fork new ones from gist.run, so that gist looks empty... if you look at the revisions here you can still see how to reproduce it. Let me know if you want me to get the gist going again.