-
Notifications
You must be signed in to change notification settings - Fork 33
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
"Change" event is not triggered #18
Comments
That's wrong. |
where you able to solve the issue @Manukam ? |
No, I put the Interesting thing is, I have other form fields in this form, and for them the event is getting fired, only for |
Did you add the JS hooks? Are you seeing errors in your browser's console? |
Hooks are working fine, I see whenever I click an option, an update msg from |
I'm confused. I thought your form was in a live component? You said you put I think it will be easier if you share your code |
Pretty new to Phoenix and trying to figure this out. Yes you are correct, my form element is in a live component, i.e I use another custom component inside the live component, this is where the live_select is defined, this sub component is defined as |
ok that makes sense. It should work. But it's hard for me to help without seeing any code
This part is weird. if you're seeing your "validate" event triggered for all fields but not for live_select, the only reason I can think of is that the hooks are not working. But if the hooks aren't working, then you shouldn't be able to select anything. Are you sure you can select something from the dropdown and then it appears in the live select input as selected element, just as it does here? Absolutely positive that you added the live select hook as explained here? Again, sharing some code would be the best way to make progress here. |
I can select something from the dropdown, but what I selected does not show up as a selected element. The dropdown simply disappears when I click on an option. When I select an option it should trigger the "change" event right? |
That's a sign that your hooks don't work. I reiterate: have you set up the hooks correctly? Can you show me what you're doing? |
Oh! You were right, it was a problem with the hooks. Thank you for this! Sorry for taking this long to figure out this silly mistake! |
Hi,
Just linking the previous issue I opened so that the code samples and the context are available.
#17
Issue is, the
handle_info
function is triggered when the user inputs characters, but once an option is clicked, thephx_change
event is not triggered. Any idea why? Is this because I am usinglive_select
inside a component?Also as mentioned in the other issues, live_select's
handle_info
is received by the parent, so, I included thehandle_event
also in the parentThe text was updated successfully, but these errors were encountered: