SfListBox Previous/Current index behaviour

Hi

Im currently working with a SFListBox. When I enabled the drag and drop feature it has some unexpected behaviour.

When I move an item from the last position to let say the second position it gives me previousIndex=4 and currentIndex=1. What I was expecting is previous=3 and current=1

image one
When I move the third item to the first spot it gives me from index 3 to index 0. Here i would expect from index 2 to 0.

picture two

Is it possible that the previous index is 1 based and the current is 0 based?
If not, what is going on here?

Edit: Fixed picture link

13 Replies 1 reply marked as answer

GK Gayathri KarunaiAnandam Syncfusion Team March 29, 2021 02:49 PM UTC

Hi Simon,  

We have checked your reported query and we can reproduce this issue in our end. We have confirmed this as an issue from our side. We have logged a bug report for this. You can track its status from the below feedback link. 


The fix will be provided in the patch release which will be scheduled on April 14th, 2021. 

Regards, 
Gayathri K 



SB Simon Balling April 4, 2021 12:45 PM UTC

Does the listbox change something on itself when using drag and drop?
im using a observableCollection as a datasource and sometimes data just changes and I dont know what changes it.

also, how does the listbox determin the index? is it the order of the items in the list?


GK Gayathri KarunaiAnandam Syncfusion Team April 8, 2021 03:50 PM UTC

Hi Simon, 

We have checked your reported query. We cannot be able to replicate the reported issue. We have prepared a listbox sample with ObservableCollection datasource. Please check the below code snippet sample. 

Code Snippet:  
 
<div class="col-lg-12 control-section"> 
    <div id="listbox-control"> 
        <h4>Select your favorite car:</h4> 
        <SfListBox DataSource="@Data" TValue="string[]" TItem="ListData" AllowDragAndDrop="true"> 
            <ListBoxEvents TItem="ListData" TValue="string[]"  Dropped="OnDropped"></ListBoxEvents> 
            <ListBoxFieldSettings Text="text" Value="id"></ListBoxFieldSettings> 
        </SfListBox> 
    </div> 
</div> 
<br /> 
<br /> 
<SfButton CssClass="e-success" @onclick="PropertyBinding">Add</SfButton> 
 
@code 
{ 
    public ObservableCollection<ListData> Data { get; set; } 
    public class ListData 
    { 
        public string id { get; set; } 
        public string text { get; set; } 
 
        public static ObservableCollection<ListData> getListData() 
        { 
            ObservableCollection<ListData> Data = new ObservableCollection<ListData>(); 
            Data.Add(new ListData() { text = "Hennessey Venom", id = "list-01" }); 
            Data.Add(new ListData() { text = "Bugatti Chiron", id = "list-02" }); 
            Data.Add(new ListData() { text = "Bugatti Veyron Super Sport", id = "list-03" }); 
            Data.Add(new ListData() { text = "SSC Ultimate Aero", id = "list-04" }); 
            Data.Add(new ListData() { text = "Koenigsegg CCR", id = "list-05" }); 
            Data.Add(new ListData() { text = "McLaren F1", id = "list-06" }); 
            Data.Add(new ListData() { text = "Aston Martin One- 77", id = "list-07" }); 
            Data.Add(new ListData() { text = "Jaguar XJ220", id = "list-08" }); 
            Data.Add(new ListData() { text = "McLaren P1", id = "list-09" }); 
            Data.Add(new ListData() { text = "Ferrari LaFerrari", id = "list-10" }); 
            return Data; 
        } 
    } 
    protected override void OnInitialized() 
    { 
        this.Data = ListData.getListData(); 
 
    } 
    private void PropertyBinding() 
    { 
        this.Data.Add(new ListData() { id = "c", text = "RAKKI" }); 
    } 
} 



If you are still facing the issue, kindly share the below details. 
·        If possible, try to reproduce the reported issue in provided sample or share the issue reproducible sample
·        Video demonstration of the issue. 
·        Syncfusion version you are using. 

Please provide the above requested information, based on that we will check and provide you a better solution quickly. 

Regards, 
Gayathri K 



SB Simon Balling April 13, 2021 06:12 PM UTC

Was this bug fixed in todays release?

I cant access the bug report


GK Gayathri KarunaiAnandam Syncfusion Team April 15, 2021 04:40 PM UTC

Hi Simon,   
  
Sorry for the inconvenience caused.  
  
We need to ensure some more cases in fixing the issue. So, we are unable to move this fix into previous patch release. So, we will include this fix in our next patch release, which will be scheduled on April 21st , 2021.  

We appreciate your patience until then. 

Regards, 
Gayathri K 



SB Simon Balling May 4, 2021 07:45 PM UTC

Hi Gayathri,

after the last update the index is correct. (i cant find the fix in the release notes, though)

There maybe is one issue left:

Imagine the following case:
I drag the first item and drop it on itself so it doesn't change position

What I expect:
previousIndex =0 currentIndex=0

What is happening:
previousIndex =0 currentIndex=1

This is undistinguishable from dragging the first item and dropping it on the second position.

Is expectation correct or is it working as intended?

Regards
Simon


GK Gayathri KarunaiAnandam Syncfusion Team May 5, 2021 05:42 PM UTC

Hi Simon, 

We have checked your reported query and we can reproduce this issue in our end. We have confirmed this as an issue from our side. We have logged a bug report for this. You can track its status from the below feedback link.  

   
We will include this fix in our upcoming patch release which will be scheduled on May 12th , 2021. 

We appreciate your patience until then. 

Regards,  
Gayathri K  



SB Simon Balling May 5, 2021 05:50 PM UTC

Hi Gayathri,

Thank you.

I cant access the ticket. could you please grant me access?

Regards
Simon


GK Gayathri KarunaiAnandam Syncfusion Team May 6, 2021 12:37 PM UTC

Hi Simon, 

Sorry for the inconvenience. 

Please find the below feedback to track the status of the bug. 


Please get back to us, if you need further assistance. 

Regards, 
Gayathri K 



GK Gayathri KarunaiAnandam Syncfusion Team May 13, 2021 05:19 PM UTC

Hi Simon, 
  
We are glad to announce that our Essential Studio 2021 Volume 1 service pack release v19.1.0.63 is rolled out and is available for download under the following link. In this release we have included the bug [current index issue in listbox]. 
 
  
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
  
Regards,            
Gayathri K 


Marked as answer

SB Simon Balling May 13, 2021 06:03 PM UTC

Hi,

unfortunately it seem like the bug isn't fixed.

You can see here: https://youtu.be/oh1xstkW7zk

Regards
Simon


GK Gayathri KarunaiAnandam Syncfusion Team May 16, 2021 03:35 PM UTC

Hi Simon, 

Sorry for the inconvenience caused. 

We have checked your reported query. We would like to let you know that an item will be dropped only it is placed below or more than half of the below item and it is intended behavior of our Listbox. And the issue of current index is not proper in Dropped event will be fixed in our upcoming patch release which will be scheduled on May 26th ,2021. We appreciate your patience until then. 

You can track the status of the bug by using the below link. 


Regards, 
Gayathri K 



GK Gayathri KarunaiAnandam Syncfusion Team May 26, 2021 01:58 PM UTC

Hi Simon, 

Thanks for the patience. 

We are glad to announce that our weekly patch release (19.1.0.65) is rolled out. We have included the fix for your issue [Dropped event current index] in this release. So, we suggest you upgrade our Syncfusion packages to our latest version to resolve this issue in your end. (19.1.0.65). 

Please let us know if you need further assistance on this. 

Regards, 
Gayathri K 


Loader.
Up arrow icon