bigskysoftware / bigskysoftware/htmx

hx-vals with nested array

Open
#3,321 2 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

HTMX version: 2.0.4

Encountered an issue when attempting to send a list of objects with hx-vals

```html
test
```
This results in request with this formdata:
`list=%22%5Bobject%20Object%5D%22`
Unescaped: list="[object Object]"

Non-objects in the list work as I would expect.

Somewhat surprisingly, nesting another object makes it work as I wanted:
```html
test
```
`parent=%7B%22list%22%3A%5B%7B%22key%22%3A%22value%22%7D%5D%7D`
Unescaped: parent={"list":[{"key":"value"}]}

Is this a bug?

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.