-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with if.bind + repeat.for + @children selector #590
Comments
I have noticed all sorts of weird issues with if.bind, I know it does not solve your issue but a workaround I found was to delay rendering using if.bind but then use show.bind for visibility |
The issue comes from Duplicated of #541 |
Adding the wrapper element breaks the |
I have created an updated gist with the fix applied but it does not seem to resolve the issure... please note that we are not using ShadowDOM. |
Thanks, I didn't check it carefully and assumed that slot was root of the issue. The issue was that value was not properly unset in PR for the fix is here #593 but it's holidays season ... so probably you gotta patch it temporarily for awhile 😄 unless @EisenbergEffect / @jdanyow can review & merge it together with #592 |
Thanks @bigopon , the latest fix seems to solve part of the problem. Now the repeat.for child elements are updated correctly in the array. But if I add another element outside of the repeat.for loop it disappears after toggling the first if
I have created an updated gist with the fix which shows the issue. Notice that console.log shows 4 elements in the array the first time and 3 the following. I do not know whether this behavior is related to this bug or not but it does not sound right :) |
@maxgrv The issues is because observer bind will ignore existing children if you are not using native shadowDOM (https://github.com/aurelia/templating/blob/master/src/child-observation.js#L173) I'm not sure why we cannot have it for light shadow DOM, and commenting that line out works fine for me. So I'll cc @EisenbergEffect @jdanyow for more insight here |
Any update on this? The |
I'm submitting a bug report
1.1.5
Please tell us about your environment:
Operating System:
Windows 10
Node Version:
8.4.0
NPM Version:
5.30
JSPM OR Webpack AND Version
webpack 3.5.5
Browser:
All
Language:
TypeScript 2
Current behavior:
When we have a situation like this:
and the
test
custom element has a property with the@children("test-child")
decorator.When we toggle the status of the visible variable (so the repeat.for is detached and attached again) we get the children array update notification but the children array has the wrong number of elements (it grows without limits each toggle, it seems that the new elements are added twice)
See this gist with console open:
https://gist.run/?id=923ce4224412a695890e8d134955c20c
Click on the toggle button. Notice how the array count increases by 3 to infinity without reason, even if the actual custom elements remain 3.
Expected/desired behavior:
The array length should be equal to the children element count.
The text was updated successfully, but these errors were encountered: