-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix incorrect path modification in dom-repeat __handleObservedPaths() #5048
Fix incorrect path modification in dom-repeat __handleObservedPaths() #5048
Conversation
Please add a regression test so we can verify the original issue remains fixed. |
deebf91
to
2f06deb
Compare
There you go. BTW the test suite for dom-repeat is over 4000 lines and of code. Would it be alright if I broke it up into multiple files in another PR? (not today, but sometime in the future) I'm thinking of one file per custom component and one file per suite. I'm not a big fan of long files because it leads me to waste a lot of time trying to find where I just left off. |
2f06deb
to
54aa3c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We generally keep it in one file if it concerns one feature. I think it is okay for now to keep it like this, to not overflow the tests directory.
test/unit/dom-repeat-elements.html
Outdated
is: 'x-repeat-filter-and-sort-by-nested-property', | ||
properties: { | ||
items: { | ||
value: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be function() { return [...]; }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I use ES2015 style value () { return []; }
?
54aa3c2
to
e72e90d
Compare
@TimvdLippe I was thinking about a folder ;) |
|
Ready to merge: It fixes a bug in Polymer that the tests previously didn't cover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation and test look good. We have to fix #5050 first and then we can merge this one
@TimvdLippe Ah okay. Thx for the update :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome fix, @MajorBreakfast and @michalsukupcak. Thanks for the contribution.
Fixes #4983
The path modification is wrong. The path is already modified in
__handleItemPath()
https://github.com/Polymer/polymer/blob/master/lib/elements/dom-repeat.html#L649
This causes the sort and filter to fail if a nested property is modified, e.g.
'items.1.prop.nestedProp'
. The current code gets the already modified'prop.nestedProp'
and incorrectly modifies it tonestedProp
.@kevinpschaaf