Commit 88d4ffd
authored
fix(cdk/drag-drop): incorrect index when returning item in mixed list (#31592)
When an item enters a mixed orientation list, we were figuring out its index, removing the item from the list and then trying to insert it in that index. The problem is that by removing the item, we might have changed the array in a way where the index isn't valid anymore.
These changes resolve the issue by removing the item first before making any index calculations.
Fixes #31505.1 parent 7482ac6 commit 88d4ffd
1 file changed
+8
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
144 | 152 | | |
145 | 153 | | |
146 | 154 | | |
| |||
154 | 162 | | |
155 | 163 | | |
156 | 164 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | 165 | | |
163 | 166 | | |
164 | 167 | | |
| |||
0 commit comments