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

hx-select conflict #2535

Open
pedrorodriguesar opened this issue May 7, 2024 · 2 comments
Open

hx-select conflict #2535

pedrorodriguesar opened this issue May 7, 2024 · 2 comments

Comments

@pedrorodriguesar
Copy link

i have a form like this and everthing works individual, but if i make together, select not work, it loads data but not show, if i remove hx-select from from(or other parent from select), everthing works fine.

htmx.logAll() show no errors

<select
id="country"
name="country"
hx-get="/country-select-options"
hx-trigger="load"
hx-target="#country"
hx-swap="innerHTML"

@pedrorodriguesar
Copy link
Author

if add hx-disinherit="*" to form solve the problem

@Telroshan
Copy link
Collaborator

Telroshan commented May 8, 2024

Hello, indeed, as per the doc

hx-select is inherited and can be placed on a parent element

So if a parent element has it, all children elements will inherit it unless you specify hx-disinherit just like you did.
Please note you can also specify hx-disinherit="hx-select" to only prevent inheriting the hx-select value but keep inheriting the other hx attributes

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

2 participants