-
Notifications
You must be signed in to change notification settings - Fork 77
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
jQuery test only ever marks the first todo item as completed #365
Comments
The issue here seems to be that the entire todo list is re-generated each time any checkbox is toggled. So we need to execute |
…odo item as completed The bug was caused by jQuery replacing the whole todo list whenever each todo item is toggled. Fixed it by running querySelectorAll in each iteration.
we had several prs closed for jQuery, both would address the whole list re-render issue: comment from me from the last example: Happy to take a look at both and open a pr for an updated version! |
Another possibility would be to use getElementsByClassName which is a live collection. This might change the performance characteristics of the workload though. |
Yeah, that's another alternative. I'd be happy with either approach. |
I can take another look at my previous ones and open a new pr for opinions? |
At this point, my preference is to take a change like #366 as opposed to a broader refactor to optimize re-renders. I'd like to make an as-narrow-as-possible-correctness-fix for 3.0, and to consider whether we should make a refactor for a future version. |
…eration (#367) This PR fixes the issue #365: jQuery test only ever marks the first todo item as completed The bug was caused by jQuery replacing the whole todo list whenever each todo item is toggled. Fixed it by running querySelector with :nth-child in each iteration. Co-authored-by: Ryosuke Niwa <[email protected]>
…eration (WebKit#367) This PR fixes the issue WebKit#365: jQuery test only ever marks the first todo item as completed The bug was caused by jQuery replacing the whole todo list whenever each todo item is toggled. Fixed it by running querySelector with :nth-child in each iteration. Co-authored-by: Ryosuke Niwa <[email protected]>
Step through jQuery suite in https://speedometer-preview.netlify.app/interactiverunner?suite=TodoMVC-jQuery
We observe that the only first item is marked as completed in "CompletingAllItems" test.
The text was updated successfully, but these errors were encountered: