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.

List automatically scrolled to the top after selecting item from the bottom of scrollable list

See original GitHub issue
  • downshift version: 1.22.3
  • node version: 8.9.3
  • npm (or yarn) version: 5.5.1

What you did: I have multiselect implemented (checkbox + label items), scrollable list, I selected the item from the bottom of scrollable list (selectItem method).

What happened: after selecting the item from the bottom of scrolled list, the list automatically scrolled to the top which is not intended behavior.

downshift-jump

Is there any way to prevent it? When I select item I want the scrollable dropdown list to stay at the same scrolled position.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
kentcdoddscommented, Dec 27, 2017

Hmm… I feel like a well placed onClick handler with event.preventDefault() could help here.

Also, there was recently a release that may have fixed this 🤔 are you on the latest?

0reactions
m0onspellcommented, Aug 11, 2022

For me it was (at least it seams so) auto focusing on search input element after you choose an element. Not sure what was causing it to focus, but since my search input is inside the menu itself on the top of the list, focusing was causing scroll to it. I just solved the problem by making search input sticky to top of the menu container.

Read more comments on GitHub >

github_iconTop Results From Across the Web

List automatically scrolled to the top after selecting item from ...
When I select item I want the scrollable dropdown list to stay at the same scrolled position.
Read more >
Keep overflow div scrolled to bottom unless user scrolls up
There is a method called *.scrollIntoView . After running this method once, it keeps the container scroll at the bottom. Even after adding...
Read more >
Automatic scrolling, only if a user already scrolled the bottom ...
First, we need a list of items, an HTML element to display these items in and a method to call for scrolling to...
Read more >
Scroll to location within component - MATLAB scroll - MathWorks
scroll ( container , vlocation ) scrolls a container or button group vertically. Specify vlocation as 'top' or 'bottom' . For more information...
Read more >
How to scroll automatically to the Bottom of the Page using ...
To auto scroll a page from top to bottom we can use scrollTop() and height() method in jquery. In this method pass 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