[Feature Request] event listener to target

Open
#554 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
frontend, web-dev

Research direction

No implementation file or test is named. Start by tracing how event listeners parse and handle from, then check how htmx afterRequest events expose their target; done means the proposed to me form matches that target and existing listener behavior remains intact.

Written by the indexing model from the issue text.

Description

When used in conjunction with htmx, I will often use _hs to perform some action at the end of the htmx swap or request.

Example:

<button hx-get="/get" hx-target="#the-target-of-htmx"></button>
<div id="the-target-of-htmx" _="on htmx:afterRequest from previous <button/> toggle .cool-style on me"></div>

What I would like is to be able to use a to keyword in place of from such that the following selector matches the target of the event such as

<div id="the-target-of-htmx" _="on htmx:afterRequest to me toggle .cool-style on me"></div>

Dominant language
JavaScript
Stars
3.8k
Forks
171
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bigskysoftware/_hyperscript

All issues in bigskysoftware/_hyperscript

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.