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

Fix event not being available in hx-vals/hx-vars when hx-trigger has delay #3196

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

Conversation

scrhartley
Copy link
Contributor

@scrhartley scrhartley commented Feb 19, 2025

Description

When using hx-vals (and hx-vars) you can reference event as shown in the docs for hx-vals.
However when a delay modifier is used in hx-trigger this stops being true, since it's actually a reference to window.event, rather than an argument being passed. This is surprising and also its documentation says:

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Corresponding issue : #1189

Testing

New tests added for hx-vals (I didn't copy them for hx-vars, but I fixed it for parity)

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

@Telroshan Telroshan added the bug Something isn't working label Feb 19, 2025
@Telroshan Telroshan linked an issue Feb 19, 2025 that may be closed by this pull request
@Telroshan Telroshan added the ready for review Issues that are ready to be considered for merging label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready for review Issues that are ready to be considered for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hx-vals does not work together with delay
2 participants