Replies: 2 comments 2 replies
-
The check itself is as intended. There is a separate check if you look for checkboxes filling to arrays. As you know, a Select multiple has fundamentally different behaviors compared to other inputs and may need it's own special check. I'd probably consider the fact it doesn't work with select multiple to be a bug though. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Should be fixed with #4159. Please give it a try. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As per the documentation of .fill: "if a bound property is empty, then you can use an input's value attribute to populate the property by adding the .fill modifier"
While this works for input fields whose value is a null or empty '' string, when I use this with a multiple select field, and if the initialised property value is an empty [] array, it does not seem to replace it with the select's values.
For example:
This sets the
selected_values
state property to [2,3]This does not work. It sets the
selected_values
state property to [] instead of [1.2]On closer inspection, it looks like the culprit could be this statement which only checks for null and === '', but not an empty array:
alpine/packages/alpinejs/src/directives/x-model.js
Line 50 in 2538570
I was wondering if this behavior is intended?
Beta Was this translation helpful? Give feedback.
All reactions