-
Notifications
You must be signed in to change notification settings - Fork 63
Description
Issue: Model Selection Dropdown Conflict
Title
v-select throws "Invalid prop: type check failed" error when selecting model in MiscConfigCard
Description
The Model Selection dropdown in the Miscelaneous Configuration card has a critical bug where the v-model and :items props are bound to the same variable (models). This causes the component to break when a user selects or deselects a model option.
When a user selects a model from the dropdown, the array of model options gets overwritten with the selected string value, causing Vue to throw a type error. Additionally, when the selection is cleared, the dropdown shows "no data available" because the items array has been replaced.
Original Behaviour
- User opens the calibration configuration page
- User clicks on the Model Selection dropdown - sees list of models
- User selects a model (e.g., "Ridge Regression")
- Vue throws error:
[Vue warn]: Invalid prop: type check failed for prop "items". Expected Array, got String - User clicks the clear button (X) to deselect
- Dropdown shows: "no data available" - no models are visible anymore
- The component is now broken and cannot be used properly
Root Cause: Both v-model and :items were bound to the same models variable:
<v-select v-model="models" :items="models" ... />This creates a conflict where:
modelsstarts as an array:['Linear Regression', 'Ridge Regression', ...]- On selection,
v-modeloverwrites it with a string:"Ridge Regression" - Vue expects an array for
:itemsbut receives a string → error - On clear,
modelsbecomesnull→ no items to display
Expected Behaviour
- User opens the calibration configuration page
- User clicks on the Model Selection dropdown - sees list of all available models
- User selects a model (e.g., "Ridge Regression")
- No errors - selection works smoothly
- The selected model is displayed in the dropdown
- User can clear the selection using the clear button (X)
- Dropdown still shows all available models when reopened
- User can select a different model at any time
- The selected model value is properly stored in Vuex store
Files Changed
src/components/calibration/MiscConfigCard.vue
Solution Applied
Separated the conflicting variable into two distinct variables:
selectedModel: Stores the currently selected model value (used withv-model)modelOptions: Stores the array of available model options (used with:items)
This ensures the items array remains intact while the selected value can change independently.
Before Fix :-
BeforeFixEyeTracker.mp4
After fix:-