question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Select - Odd autoscroll behavior in Select

See original GitHub issue

Expected Behavior

When onMore occurs and adds items to options the user’s cursor should remain at the item index in the list on which they currently have focus.

Actual Behavior

An unexpected autoscroll occurs after an initial onMore is called, more data is loaded, and then the user moves their cursor. I will create a minimal code example which reproduces this experience and add it to this issue.

These are the steps which trigger the scroll behavior shown in the video below:

  • Open modal containing a Select input.
  • Click on Select dropdown to reveal the first set of options. options is initially populated with a list of 50 items.
  • Scroll down through the options to approximately the 75% point in the scrollbar to trigger the onMore call. onMore triggers a call to the API, retrieving the next 50 items adding them to options. Note: I did replicate the same behavior with an array, taking the next slice to remove the API call from the possible variables.
  • Stop scrolling. (in the video, the cursor is on the cursor is on “Hawaii” when this occurs at ~00:08).
  • Note: The height of the scroll control reduces as the next 50 items are provided as options at 00:09.
  • All is fine as long as the cursor remains on the currently active item (e.g. “Hawaii”).
  • However, as soon as the cursor moves onto another item (00:12), which would become the next active index, the unexpected autoscroll occurs, skipping about 40 items and resolving at an item called “athena-f-2004200” at 00:14.

https://user-images.githubusercontent.com/1756948/179840901-03d32e29-2e37-458b-8d74-6d50458b1840.mov

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
haloclinecommented, Jul 19, 2022

Appears to have been introduced in https://github.com/grommet/grommet/pull/5934.

Screen Shot 2022-07-19 at 4 33 43 PM
0reactions
haloclinecommented, Jul 19, 2022

Autoscroll also occurs with keyboard. Additionally, at a certain point the keyboard is no longer able to reach item indexes less than ~25:

https://user-images.githubusercontent.com/1756948/179853121-78979b15-6bde-408e-95ac-de3d8bf2e47d.mov

Read more comments on GitHub >

github_iconTop Results From Across the Web

Odd Draggable Behavior After Implementing Auto Scroll
I'm using Chrome (22) and it seems to work for me. When I keep my dragged item in the top grey zone, it...
Read more >
scroll-behavior - CSS: Cascading Style Sheets - MDN Web Docs
The scroll-behavior CSS property sets the behavior for a scrolling box when scrolling is triggered by the navigation or CSSOM scrolling APIs.
Read more >
Issue with Automatic Scrolling in Drop Down Menus and ...
Click “Run programs made for previous versions of Windows” option from the list appeared in the left side. Select the drivers and install....
Read more >
[Bug Report] V-Select scrolling behaviour · Issue #2660 - GitHub
Give the select component a largish number of items (anything above 50 will do). Open the select and start scrolling. Expected Behavior. The ......
Read more >
making selections "under the fold" causes the grid to auto ...
When I click on the check that are below the scope of the window it causes the grid to auto scroll all the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found