- π©πͺGermany Anybody Porta Westfalica
Is this still an issue with 2.0.x? If yes, please update the version and set the status active again with clear steps or (best) with a test showing what's broken.
2.0.x is the active development branch.
If nobody replies, we should assume this is fixed and close this issue outdated.
Thanks!
- πΊπΈUnited States t_stallmann
Hi, yes this is still an issue on version 2.0 without the patch. To reproduce:
Create a view with views infinite scroll but without the autoscroll behavior. Using the keyboard, focus the "Load more" button and hit enter.
Desired behavior: More rows load and focus jumps to the first focusable item in the first new row.
Actual behavior: More rows load and focus stays on the "Load more" button.
- Status changed to Active
almost 2 years ago 2:18pm 22 July 2023 - π©πͺGermany Anybody Porta Westfalica
Does anyone know why
clone()
was used before?- .trigger('views_infinite_scroll.new_content', $newRows.clone()) + .trigger('views_infinite_scroll.new_content', $newRows)
Doesn't really make sense to me...
Could someone look up the issue via GitLab blame and see if there was a reason given?
- Status changed to Needs work
almost 2 years ago 9:10am 24 July 2023 - πΊπΈUnited States kentr Durango, CO
@anybody
Could someone look up the issue via GitLab blame and see if there was a reason given?
I don't see a reason. Looks like it was added in commit 95af31da for #3068579: Add a jQuery event when new content is loaded β .
Since the second argument of
.trigger()
is used to pass data to event handlers, the.clone()
might have been to prevent mutation of the$newRows
object by buggy event handlers. - π©πͺGermany Anybody Porta Westfalica
Thanks, someone should please create a MR from the patches.
- πΊπΈUnited States kentr Durango, CO
There's an MR for review.
I kept the
.clone()
because the other changes solved the OP issue of focusing the first new content item and it's unknown why the.clone()
was used.I added tests and fixed some issues with the preexisting test. There are details in the commit messages. I'm happy to revert anything that's problematic.
As a separate issue, the call to
.trigger()
looks incorrect to me for the current version of jQuery. As it is, event handlers receive the new content items as individual arguments instead of as a single jQuery collection object. jQuery docs say to pass the data wrapped in an array or a plain object, but that would break BC.