mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-10 09:22:34 +00:00
Fix #3443: Datatable: RowReorder fails in case of pagination on page other than first & last
This commit is contained in:
parent
ab885948c5
commit
7289eb8323
2 changed files with 3 additions and 8 deletions
|
@ -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]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue