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

feat: add support for hx-target-* attribute #271

Closed
a-h opened this issue Nov 1, 2023 Discussed in #269 · 1 comment
Closed

feat: add support for hx-target-* attribute #271

a-h opened this issue Nov 1, 2023 Discussed in #269 · 1 comment

Comments

@a-h
Copy link
Owner

a-h commented Nov 1, 2023

Discussed in #269

Originally posted by koddr November 1, 2023
Hi,

First, let me thank you for this amazing tool that allows you to develop the Go web applications very quickly! Love it 😘

I noticed that the plugin for VSCode does not full support the htmx extension response-targets:

screenshot

It would be really cool if you could add wildcard support.

Right now, you have to define each hx-target like this:

<form
 	hx-post="/api/secret/unlock"
 	hx-target="#secret"
 	hx-target-400="#errors"
 	hx-target-403="#errors"
 	hx-target-404="#errors"
 	hx-target-500="#errors"
 	hx-target-502="#errors"
 	hx-target-503="#errors"
 	hx-indicator="#loading-indicator"
>
...

Although it could be simplified to:

<form
 	hx-post="/api/secret/unlock"
 	hx-target="#secret"
 	hx-target-*="#errors"
 	hx-indicator="#loading-indicator"
>
...

Thanks for your time and templ library! 😊

@a-h
Copy link
Owner Author

a-h commented Nov 1, 2023

See #269 (comment) for implementation instructions.

@a-h a-h closed this as completed in 43545f8 Nov 6, 2023
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

No branches or pull requests

1 participant