Conversation
Enact-DCO-1.0-Signed-off-by: Jiye Kim (jiye.kim@lge.com)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/1.9.x.develop #430 +/- ##
=========================================================
- Coverage 81.70% 81.69% -0.02%
=========================================================
Files 153 153
Lines 7342 7335 -7
Branches 2222 2220 -2
=========================================================
- Hits 5999 5992 -7
Misses 1037 1037
Partials 306 306 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
this still returns before the hasProcessedKeyDownRef.current = true assignment at line 253. That means the bug still reproduces whenever a list is entered mid-list instead of at a boundary .
we need to set here
hasProcessedKeyDownRef.current = true;
There was a problem hiding this comment.
isFirstEntryRepeat indicates whether the long press when entering this VirtualList is still ongoing,
and hasProcessedKeyDown indicates whether a new keyDown event occurred after entering this VirtualList.
isFirstEntryRepeat was defined to prevent scrolling when a long press starts outside the VirtualList.
It was intentional that the keyDown event was blocked.
So if we set hasProcessedKeyDownRef.current = true; here, when focus moved into the VirtualList, it will be treated as new key press occured, so the scroll will continue.
In Limestone, scroll stops with long press from outside, so I added isFirstEntryRepeat.
But in Sandstone, scroll continues.
We decided to delay to merge until we find which behavior is correct.
There was a problem hiding this comment.
To match VirtualList behavior of Enact and Elemental UI, we decided to scroll works with long press from outside.
As isFirstEntryRepeat was introduced to block it, I removed the codes related to isFirstEntryRepeat.
daniel-stoian-lgp
left a comment
There was a problem hiding this comment.
please also add a unit test for the fixed scenario
|
how about adding these unit tests as guards for the future? ` test('should keep blocking repeat keydown for the whole long press that entered the VirtualList', () => { |
Checklist
Issue Resolved / Feature Added
When holding down a down key (long press) to move between multiple horizontally-arranged VirtualLists,
focus stopped and did not continue to the last one.
Resolution
In #361,
isFirstEntryRepeatwas defined to block the scroll when entered a VirtualList from outside with long press.Here, keyDown event handler is blocked if
isFirstEntryRepeatis true, which means key was pressed before entering the VirtualList and there wasn't a new key press. this makes scroll can newly start in the VirtualList after new key press.But in case of focus move between VirtualLists, not between Items in a VirtualList, keyDown handler is needed to keep focus moving between the VirtualLists.
The condition of
isFirstEntryRepeatshould be detect the focus is moving within the VirtualList or not.So I added
isMovingWithinListcondition.Additionally, I added
isMovingWithinListcontidion inisOutdatedIndexto prevent a possible issue.Additional Considerations
Links
NXT-19990
Comments
Enact-DCO-1.0-Signed-off-by: Jiye Kim (jiye.kim@lge.com)