Fix #3443: Datatable: RowReorder fails in case of pagination on page other than first & last

This commit is contained in:
FlipWarthog 2023-01-06 19:22:05 -05:00
parent ab885948c5
commit 7289eb8323
2 changed files with 3 additions and 8 deletions

View file

@ -106,15 +106,10 @@ export default {
},
reorderArray(value, from, to) {
let target;
if (value && from !== to) {
if (to >= value.length) {
target = to - value.length;
while (target-- + 1) {
value.push(undefined);
}
to %= value.length;
from %= value.length;
}
value.splice(to, 0, value.splice(from, 1)[0]);