When dragging an article with an open nest, the `jquery.mjs.nestedSortable`
library does not refresh the positions of the following articles. This forces
the user to drag the nest far below the target position to move the placeholder.
This commit is a small fix to the library, to refresh said positions before
checking for element intersection.
Task-2883290
closesodoo/odoo#95749
Related: odoo/enterprise#29315
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Prevent a flickering effect when dragging item down in a nested tree using the
`jquery.mjs.nestedSortable` library.
Situation:
1.) start dragging, moving down and slightly to the left
.dragged item
.nest0
.nest00
.nest000
2.) intersect nest0
.nest0:hover:.dragged item
.nest00
.nest000
.drop destination
3.1.LIBRARY) intersect nest00 first trigger
.nest0
.nest00:hover:.dragged item
.nest000
.drop destination (frame 1)
3.2.LIBRARY) intersect nest00 second trigger (slightly below and to the left)
.nest0
.nest00:hover:.dragged item
.nest000
.drop destination (frame 2)
frame 1 and frame 2 are rendered almost simultaneously, and in a cycle (after
3.2. comes 3.1. again), resulting in a flickering effect.
3.1.FIXED) intersect nest00
.nest0
.nest00:hover:.dragged item
.nest000
.drop destination
drop destination is not allowed to go UP in the dom since the mouse is lower
than before. No flickering in this case.
To go up in the tree, the user can simply move the cursor to the right and/or
up.
The `jquery.mjs.nestedSortable` library will be rewritten internally in the
future to remove the jQuery dependency, but this fix allows a smooth utilisation
in the meantime.
Task-2883290
Part-of: odoo/odoo#95749