Skip to content
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

use wildcard (*) to match "revealed" trigger when scrolling #2237

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

danielnieto
Copy link
Contributor

Description

Fixes #2233, using wildcard to match "revealed" trigger when collecting elements to execute maybeReveal on while scrolling allows using more events in the same hx-trigger attribute (i.e. click, mouseenter, custom events, etc)

A minimal example to reproduce the bug is included in the original issue.

Corresponding issue: #2233

Testing

The only way to test this is to have an element with hx-trigger="revealed, anyOtherEvent" below the fold (so that the initial maybeReveal function would not trigger the request)

I've updated scroll-test-eventHandler.html manual test to include 3 cases (at the very bottom), when the reveal event appears first, when it's last and when it's in the middle. All of them working after applying the fix.

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • I ran the test suite locally (npm run test) and verified that it succeeded

Copy link

@carducci carducci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grateful for this pull request. I've been running this patched version in production for a couple of months. Many thanks to the authors and contributors in this community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants