Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select with lazy load scrolls back to previous item when new items are added #4270

Closed
1 task done
Chris3y opened this issue Jul 23, 2021 · 2 comments · Fixed by #4316
Closed
1 task done

Select with lazy load scrolls back to previous item when new items are added #4270

Chris3y opened this issue Jul 23, 2021 · 2 comments · Fixed by #4316

Comments

@Chris3y
Copy link

Chris3y commented Jul 23, 2021

Current behaviour

You can recreate this on the infinite scroll example:
https://carbon.sage.com/?path=/story/design-system-select--with-infinite-scroll

When scrolling to the bottom, the Select uses lazy load to add new pages of options.

Scrolling position is maintained as each new set is added.

However if you actually choose and option first (e.g.) one of the initial ones, such as "Black" and then scroll to the bottom [using the mouse], the list will "jump" back to the selected item with every new page load.

Expected behaviour

I would expect it to consistently maintain scroll position and not jump the length of the list with every new page load.

CodeSandbox or Storybook URL

https://carbon.sage.com/?path=/story/design-system-select--with-infinite-scroll

Suggested Solution

Suggestion would be to maintain the same behaviour as when the Select has no item selected initially.

Carbon Version

77.12.0

What browsers are you seeing the problem on?

Chrome

What Operating System are you seeing the problem on?

Windows

Anything else we should know?

Confidentiality

  • I confirm there is no confidential or commercially sensitive information included.
@Chris3y Chris3y added Bug triage Triage Required labels Jul 23, 2021
@jamime jamime changed the title Select (with lazy load)'s scrolling behaves erratically when an item is selected Select with lazy load scrolls back to previous item when new items are added Jul 27, 2021
@jamime
Copy link

jamime commented Jul 27, 2021

FE-4244

@jamime jamime added On Backlog Squad 200 and removed triage Triage Required labels Jul 27, 2021
carbonci pushed a commit that referenced this issue Aug 20, 2021
### [81.2.2](v81.2.1...v81.2.2) (2021-08-20)

### Bug Fixes

* **select:** scroll option into view when using keyboard navigation ([d09ef73](d09ef73)), closes [#4270](#4270)
@carbonci
Copy link
Collaborator

🎉 This issue has been resolved in version 81.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants