-
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
Fixes #3065: Add dom-repeat.renderedItemCount property #3066
Conversation
*/ | ||
renderedItemCount: { | ||
type: Number, | ||
notify: true |
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.
Let's add readOnly: true
, because setting it doesn't make any sense.
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.
Good point!
Can you add a test case for reacting to |
I'm not sure I how to test that using WCT. Is there a similar test case somewhere I can look at? Specifically, I don't see any tests in the dom-repeat tests that are catching an event. Could it be as simple as something like:
Or do I need to do some kind of async thing to catch the event? |
I don't know if this is what you're looking for, but I added a test showing the |
Ping. Let me know if this is what you intended. |
LGTM! |
Fixes #3065: Add dom-repeat.renderedItemCount property
I'm not sure whether this is desirable or not, but it seems like the
dom-repeat
has this information readily available, and extracting it yourself relies on either accessing internal properties (_instances
) or using side effects (domRepeat.indexForElement(domRepeat.previousSibling)+1
for example).Seems like it could either be exposed as a property with
notify
, or simply as a property on thedom-change
event. The event property might be the most efficient, but an element property seemed more Polymeric.Feel free to close if this isn't the right API or I'm going about it the wrong way.