Automattic / Automattic/jetpack

Custom #infinite-handle button doesn't works

Open
#17,384 0 comments 0 reactions 0 assignees View on GitHub
[Feature] Infinite Scroll [Pri] Low Bug Good For Community
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

Custom `#infinite-handle` button doesn't works because there is incorrect `click` event handler: https://github.com/Automattic/jetpack/blob/3fe20501f562c5a8c8009d43e95b50620b957d29/modules/infinite-scroll/infinity.js#L98

#### Steps to reproduce the issue

```php
add_theme_support( 'infinite-scroll', array(
'type' => 'click',
'click_handle' => false,
) );
```

1. Create button with ID `infinite-handle` `Show more`
2. Set `'click_handle' => false,`

#### What I expected

Button works as default button.

#### What happened instead

Nothing happens.

---

The root of the issue is incorrect `this.handle` assignment to new element instead of existed one: https://github.com/Automattic/jetpack/blob/3fe20501f562c5a8c8009d43e95b50620b957d29/modules/infinite-scroll/infinity.js#L47-L49

Contributor guide

Open the contributing guide

Research direction

Start in modules/infinite-scroll/infinity.js at the handle assignment around lines 47-49 and the click handler around line 98. Reproduce the issue with a custom #infinite-handle button and click_handle set to false; done means the custom button triggers the default infinite-scroll loading behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php, wordpress
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.