[QuickForm] - Problem with quickform sorting

Description

Case

Prices before sort

 

Prices after sort and clicked at first cell

 

Scenario

 

1. Click on the first row of the quickForm

2. Modify the discount value in the respective field.

3. Without clicking outside the discount field, sort the table by the product column.

4. After sorting, identify the product that has now moved to the first row and change its discount value.

5. Observe that the previously edited fields are lost, and the values are incorrect.

Environment

Attachments

5
  • 04 Feb 2025, 06:40 PM
  • 24 Jan 2025, 12:42 AM
  • 20 Jan 2025, 01:02 PM
  • 15 Jan 2025, 07:28 PM
  • 15 Jan 2025, 07:28 PM

Activity

Heng Sin Low 
March 3, 2025 at 1:49 AM

hi , the if try to detect if it is necessary to update the currentRow instance variable. From the test case, it is obvious that the condition in the if block is insufficient for what it means for. Since it is harmless to update currentRow when it is not needed, I just remove the if clause.

zuhri utama 
March 2, 2025 at 11:50 PM

thx , i can reproduce the bug using your flow. the PR looks good. just curious what is the main culprit cause the PR only remove the if clause if (row != currentRowIndex || pgIndex != currentRowIndex) {

Heng Sin Low 
March 2, 2025 at 6:27 AM

Steps to reproduce:

Open Sales Order with 2 Line, for example:

  • Line 10 is Doc_How To Plant

  • Line 20 is Planting_Planting Service

Open Quick Form

  • Focus is In Line No 10

  • Click "Product" column header to sort by Product ascending

  • Click on "Price" input field of current row, focus is now in the price input field

  • Click on "Product" column header to sort by Product descending. Focus is now in Line No 20

  • Click on "Price" input field of current row. Both row will now show the same output.

Jose Leite 
February 13, 2025 at 5:31 PM

Hi

Yes, doing these steps always happens, for old and new documents, this happens because the current line of the form is not updated and then the callout picks up incorrect values

zuhri utama 
February 10, 2025 at 1:13 AM

Hi , I tried your workflow. but sometimes it work and sometimes not. I tried with new document but failed to reproduce the bug. do you tested and always found the bug? have you tried with new document?

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created January 15, 2025 at 7:28 PM
Updated May 1, 2025 at 10:26 PM
Resolved March 4, 2025 at 2:15 PM