-
-
Notifications
You must be signed in to change notification settings - Fork 464
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
Incorrect ui.oldindex
and ui.item.index()
when using items
options
#48
Comments
For Ember users who may have the same problem, my workaround is to use |
Wouldn't it be sensible to do it this way, because if you want to add an item to the list the actual position it should be appended to is the index you get. I don't know ember, and the <ul>
<li class="disabled">...<li>
<li>...</li>
<li>...</li>
<li>...</li>
</ul> |
@lukasoppermann I agree that it's weird ember generates such script tags and they're actually breaking the HTML structure. Nevertheless, since the |
@lacek I see what you mean, as I thought the same for a moment, but consider you want to add an item into your list at the visual index 2. If you would use Do you have a use-case where it is necessary to have the index of only the items? I guess you could always send a PR adding another value to the event like I do also agree on a need to document this behaviour so maybe you want to send a separate PR for this? |
I am using Ember to
{{each}}
helper to create a list, which looks like below:All the script tags are Ember-generated as metaphor.
The following script is used to show the change of indexes:
Both
data.oldindex
anddata.item.index()
are shift by 3 due to the script tags. Is this behavior intended or unexpected?JSBin: http://jsbin.com/sidugi/edit
The text was updated successfully, but these errors were encountered: