Describe the bug
When using createProjection in Solid 2.0, mutating the draft proxy array by setting an element and subsequently modifying its properties inline causes issues if a preceding element is deleted via .splice(). The subsequent elements are shifted down in index, but their assigned properties are lost or not correctly tracked/re-emitted.
// 1. Assigning the base element to an index
draft[index] = { id: item.id };
// 2. Setting individual properties sequentially
draft[index].status = item.status; // <--- These assignments are dropped
draft[index].title = item.title; // <--- for shifted elements after splice
// ... later in the block ...
draft.splice(i, 1); // Triggers the bug
Your Example Website or App
https://stackblitz.com/edit/vitejs-vite-otx8tbew?file=src%2FApp.tsx
Steps to Reproduce the Bug or Issue
- Go to stackblitz example
- Click delete on either T1 or T2
The title and status values disappear from T3 in the "Not working" example
Repro steps in code:
- Create a projection draft array with objects
- Update an item by first assigning the base object: draft[index] = { id: item.id }
- Mutate that newly assigned object's properties inline: draft[index].title = item.title
- Later in the same execution block, remove a previous item from the array using draft.splice(i, 1)
- Trigger a reactivity update (e.g., updating the deleted signal).
Expected behavior
The remaining items should shift down in the array while maintaining their complete internal state (id, title, and status).
Screenshots or Videos
No response
Platform
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Version: [e.g. 91.1]
Additional context
No response
Describe the bug
When using
createProjectionin Solid 2.0, mutating the draft proxy array by setting an element and subsequently modifying its properties inline causes issues if a preceding element is deleted via.splice(). The subsequent elements are shifted down in index, but their assigned properties are lost or not correctly tracked/re-emitted.Your Example Website or App
https://stackblitz.com/edit/vitejs-vite-otx8tbew?file=src%2FApp.tsx
Steps to Reproduce the Bug or Issue
The title and status values disappear from T3 in the "Not working" example
Repro steps in code:
Expected behavior
The remaining items should shift down in the array while maintaining their complete internal state (
id,title, andstatus).Screenshots or Videos
No response
Platform
Additional context
No response