Closed LTKort closed 6 months ago
@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: {label: 'Lars', value: 1}
After: {label: 'Lars', value: '1'}
@taylorotwell @davidhemphill shame
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.