Bug #10791
DOWN and UP events in a simple COMBO-BOX don't select the list item correctly every time
100%
Related issues
History
#1 Updated by Delia Mitric 9 months ago
Like Vladimir wrote in #10736-11, the issues are these:
- When the user types a value and then switches to the list by pressing DOWN:
In OE: The matching item is selected (or the first item if no match).
In FWD: The previously selected item is re-selected. - When the user switches to the list with DOWN, then presses Left or Right, then Down or Up:
In OE: The next (for Down) item or previous (for Up) item is selected, and the VALUE-CHANGED event is triggered with the newly selected value.
In FWD: The selected item remains the same, the VALUE-CHANGED event is triggered for this currently selected item.
This can be reproduced by any testcase which implies a simple COMBO-BOX (with an entry field), but here is a testcase:
DEF VAR cb1 AS CHARACTER
VIEW-AS COMBO-BOX INNER-LINES 10
LIST-ITEMS
"a", "b", "c"
SIMPLE
SIZE 40 BY 5
NO-UNDO.
DEFINE FRAME f
cb1
WITH 1 DOWN SIDE-LABELS.
ENABLE ALL WITH FRAME f.
DEFINE VAR i AS INTEGER NO-UNDO INITIAL 0.
ON VALUE-CHANGED OF cb1 DO:
i = i + 1.
MESSAGE cb1:SCREEN-VALUE i.
END.
WAIT-FOR CLOSE OF CURRENT-WINDOW.
#4 Updated by Delia Mitric 9 months ago
I've noticed that in FWD, if we write something (different from the first list item) in the entry field and press DOWN, the selection is made correctly. If we delete the text from entry field while the item is selected in the list and introduce a value that match with the first item and press DOWN then, the previous item remains selected. If we write something else in the entry field and press DOWN, the selection in the list is made correctly.
#5 Updated by Delia Mitric 9 months ago
Delia Mitric wrote:
I've noticed that in FWD, if we write something (different from the first list item) in the entry field and press
DOWN, the selection is made correctly. If we delete the text from entry field while the item is selected in the list and introduce a value that match with the first item and pressDOWNthen, the previous item remains selected. If we write something else in the entry field and press DOWN, the selection in the list is made correctly.
More than that, I've found now that in FWD this happens just for a combo-box which have a list for which all the items fits in the space of the combo-box (no scrollbar).
#6 Updated by Delia Mitric 9 months ago
I think I found another difference between FWD and Progress when an item from the list is selected based on the entry field text:
Scenario: introduce a text which has the same prefix like an item from the list (but the list don't contain an item with exactly the same full text) and press DOWN:
- In Progress: because the text from the entry field is not entirely found in the list, the first list item will be selected
- In FWD: the element with the same prefix is selected
If we fix this can help for solving the second problem described in #10791-1
#7 Updated by Vladimir Tsichevski 9 months ago
Delia Mitric wrote:
I think I found another difference between FWD and Progress when an item from the list is selected based on the entry field text:
Scenario: introduce a text which has the same prefix like an item from the list (but the list don't contain an item with exactly the same full text) and pressDOWN:
- In Progress: because the text from the entry field is not entirely found in the list, the first list item will be selected
- In FWD: the element with the same prefix is selected
If we fix this can help for solving the second problem described in #10791-1
Several team members are currently working on COMBO-BOX issues. To improve coordination, I suggest creating a central hub task, such as "COMBO-BOX Issues," and linking all related issues to it.
#8 Updated by Delia Mitric 9 months ago
- Related to Bug #10801: COMBO-BOX issues added
#13 Updated by Delia Mitric 9 months ago
I think we need to modify when the selection is cleared for a ScrollableSelectionListGuiImpl list in EntryFieldGuiImpl.processKeyEvent to solve the second issue from the first note.
When CURSOR_LEFT or CURSOR_RIGHT events are processed for an entry field, the selection from entry field and list is cleared. The selection from the list shouldn't be cleared if the entry field text wasn't changed (the cursor just moved LEFT/RIGHT in the entry field).
#14 Updated by Delia Mitric 9 months ago
- Status changed from WIP to Review
- % Done changed from 80 to 100
Modified the ComboBoxGuiImpl.entryFieldChanged. If the value wrote in the entry field matches the first item from the list, select the first item or if there is no "found" item in the list, select the first item (by default).
Also, changed EntryFieldGuiImpl.processKeyEvent method to clear the selection from the list if the event to process is not CURSOR-LEFT or CURSOR-RIGHT. This "keeps" the selected list item even if we move the cursor in the entry field (without changing its value). We need to know the selected item to select the next item if DOWN event is processed or the previous one for UP event is processed for the COMBO-BOX.
This is the patch:
I committed it to 10791a revision 16253.
Vladimir, please review it 🙂
#17 Updated by Vladimir Tsichevski 8 months ago
Delia Mitric wrote:
Vladimir Tsichevski wrote:
Code Review 10791a, Revision 16253
EntryFieldGuiImpl
Update the copyright message years to 2015–2025.
The change is otherwise good.
Done (rev. 16254).
So, can we proceed with the testing?
Please, rebase 10791a to the recent trunk.
#18 Updated by Delia Mitric 8 months ago
Vladimir Tsichevski wrote:
Delia Mitric wrote:
Vladimir Tsichevski wrote:
Code Review 10791a, Revision 16253
EntryFieldGuiImpl
Update the copyright message years to 2015–2025.
The change is otherwise good.
Done (rev. 16254).
So, can we proceed with the testing?Please, rebase 10791a to the recent trunk.
10791a rebased to the recent trunk
#19 Updated by Vladimir Tsichevski 8 months ago
Delia Mitric wrote:
Vladimir Tsichevski wrote:
Delia Mitric wrote:
Vladimir Tsichevski wrote:
Code Review 10791a, Revision 16253
EntryFieldGuiImpl
Update the copyright message years to 2015–2025.
The change is otherwise good.
Done (rev. 16254).
So, can we proceed with the testing?Please, rebase 10791a to the recent trunk.
10791a rebased to the recent trunk
I still see 16254. Probably, you did not push the branch after rebase?
#21 Updated by Vladimir Tsichevski 8 months ago
Delia Mitric wrote:
Vladimir Tsichevski wrote:
I still see 16254. Probably, you did not push the branch after rebase?
Yes, that's it. Now it should be rebased.
Core review and testing: 10791a rev. 16280.
The change looks good and fixes the original issue.
#27 Updated by Șerban Bursuc 8 months ago
Customer smoke tests passed.
Besides the mentions in #10736-45, I have nothing to add.
#28 Updated by Razvan-Nicolae Chichirau 8 months ago
ChUI regression tests passed for 10791a.
#31 Updated by Radu Apetrii 8 months ago
- Status changed from Internal Test to Merge Pending
Wonderful! 10791a can be merged after 10800a.