up-autosubmit on alpinejs input field #523
-
I'm using AlpineJS for some extra reactivity, specifically to change the ui around an input field. Surprisingly, when the non-alpine-field is updated, the form is autosubmitted and the value of the alpine-field is sent as well, and it contains the right value. Any idea how I could fix this? I've thought of using $watch (from alpine) but was wondering if there's anything I can do with unpoly itself (or if this is a bug). The code to make this more concrete:
Live demo: https://jsfiddle.net/8pwr5e31/1/ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I haven't worked with AlpineJS, but
You can implement this example without any JavaScript, by having the gender buttons be labels for a hidden radio button: https://jsfiddle.net/w4a3rp82/5/ |
Beta Was this translation helpful? Give feedback.
I haven't worked with AlpineJS, but
[up-autosubmit]
relies oninput
orchanged
events being fired. If Alpine changes the value of an input without firing such an event, Unpoly will not know that anything changed.You can implement this example without any JavaScript, by having the gender buttons be labels for a hidden radio button: https://jsfiddle.net/w4a3rp82/5/