I have 2 lists available tests and selected tests with a PrimeNg Drag Drop control. If the test has started, I prevent changing it’s sort order using the [cdkDragDisabled] property.
Currently, if a user drags a test from the available tests list to the selected tests list, I add the dropped test to the end of the selected tests list. I would like to actually insert the dropped test into the spot the user dropped it in the selected tests list unless the next test is already marked started and then I’d like to add it after the last started test.
Example:
Available tests: Math 101, Math 201, Math 301, Math 320, Math 421
Selected tests: Math 101 (started), Math 301 (started), Math 201
If I drop Math 421 at the start of the Selected tests list, I want to bump it down so that it is after Math 301 (started) but before Math 201. I know the PrimeNg DragEvent has several x & y properties (client, movement, offset, page, screen) but not sure how to use those to calculate the insert spot in the Selected Tests list or if the drop index is somewhere in the DragEvent that I haven’t found.
TIA