bigskysoftware / bigskysoftware/htmx

Add next and previous methods to javascript api

Open
#3,405 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
49.4k
Forks
1.7k
Avg merge
3d 22h
Merged PRs (30d)
30

Description

As it stands, the javascript API has the following methods for querying elements:
- `find`
- `findAll`
- `closest`

These methods match some of the custom selectors that are supported by the [hx-target attribute](https://htmx.org/attributes/hx-target/).

It would be handy if the remaining selectors (`next` and `previous`) were made available through a public api in the same way that `find` and `closest` are made available.

There seem to be functions that already exist for this ([`scanForwardQuery` ](https://github.com/bigskysoftware/htmx/blob/e4f8fe9a7719533074d397446200a2795fe9a7ad/src/htmx.js#L1205)and [`scanBackwardQuery`](https://github.com/bigskysoftware/htmx/blob/e4f8fe9a7719533074d397446200a2795fe9a7ad/src/htmx.js#L1221)) but they are not public and therefore cannot be used.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.