$el not pointing to proper element for radio buttons #2716
-
I ran into an issue since the CSP build doesn't support x-model yet (there is a relevent PR that can hopefully be merged soon). I was trying to bind to the checked attribute of a radio button as a workaround in my current code, but the $el magic just points to the currently selected input (not the actual $el of the relevant input being listened to on the DOM). Here's a snippet of code:
I even tried |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ah, I see... it actually does properly update the "checked" attribute but for some reason it isn't coming into the input radio DOM elements However, when binding the :checked to an external method (i.e. for CSP) it doesn't work properly when using a getter function. If I change the getter to a normal function, it seems to work properly. I'm guessing this is some side effect of the way this method is being called, but either way this works fine for my use case. |
Beta Was this translation helpful? Give feedback.
Ah, I see... it actually does properly update the "checked" attribute but for some reason it isn't coming into the input radio DOM elements
value
property (for example when I dodocument.querySelector('[required]').value
. I suppose this is probably "expected" according to how confusing the value property can be. Anyway, the form properly handles the input changing and when I submit the form, so that works.However, when binding the :checked to an external method (i.e. for CSP) it doesn't work properly when using a getter function. If I change the getter to a normal function, it seems to work properly. I'm guessing this is some side effect of the way this method is being called, but either…