-
Notifications
You must be signed in to change notification settings - Fork 34
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
Select Field does not return a value on v4.32.12 (strict equality issue) #6211
Comments
@taylorotwell @davidhemphill shame |
@crynobone If I add a function to map the option values to a string, the Select field & strict equality seems to be working. Example: mappedOptions() {
let mappedOptions = this.currentField.options.map(option => {
return { label: option.label, value: `${option.value}` }
})
return Object.assign(this.currentField.options, mappedOptions)
}, Before: |
Yep, blew up production this morning. Does anyone test these changes? |
The reality is that they are not using Nova at all otherwise they would have spot those issues immediately |
been 2 days, any update on this? |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description:
Since the update for v4.32.12, a Select field with options that uses an Integer as key is not returned as a valid selectedOption.
In the SelectField.vue there are some changes made with comparisons:
The key type (this.currentField.value) differs from the selected options key type (v.value), which causes an empty selectedOption.
It looks like the selected value is compared as text vs number, while PHP sets the value as an integer.
The issue does not appear in v4.32.11
Detailed steps to reproduce the issue on a fresh Nova installation:
Add a Select field to an Action, fill the with options
$options = User::limit(5)->pluck("name", "id");
(Array or Collection)Run the action, the field value for the handle with be empty.
The text was updated successfully, but these errors were encountered: