Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tanushree-coder-girl
Copy link

Enhancement: Scroll to selected item in Dropdown and Multi-select

Current Behavior

  • Dropdowns always open from the top.
  • Selected items may be out of view in large lists.

New Behavior

  • Single-select dropdown scrolls to the selected option when opened.
  • Multi-select dropdown scrolls to the first selected option when opened.
  • Applied behavior to both dropdown and multi-select columns in table components.

Implementation

  • Used virtualizer.scrollToIndex(firstSelectedIndex, { align: 'center' }) to scroll to the selected option.
  • Scroll is triggered only when the menu opens to avoid unexpected jumps during selection changes.
  • Logic safely handles both single-select and multi-select cases.

Testing

  • Tested with small and large option lists.
  • Verified behavior for Single-select dropdown, Multi-select dropdown, Table column dropdowns and multi-selects

Notes

This PR is created from the lts-3.16 branch as requested.

Issue Reference

Fixes #14770

@bito-code-review
Copy link

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at [email protected].

@tanushree-coder-girl
Copy link
Author

Hi @RudraPratik30
As discussed on the previous PR, this one is raised against the lts-3.16 branch.

It includes:
Scroll-to-selected behavior for single-select dropdown
Multi-select: scrolls to the first selected option
Same behavior applied to table dropdown & multi-select columns
Please check and merge. Thanks!

@RudraPratik30
Copy link
Collaborator

Hi @tanushree-coder-girl, thanks for raising a new PR and making the requested changes. I will get this reviewd from the team.

@johnsoncherian johnsoncherian changed the base branch from lts-3.16 to release/appbuilder-s20 December 19, 2025 09:11
@johnsoncherian johnsoncherian dismissed shaurya-sharma064’s stale review December 19, 2025 09:11

The base branch was changed.

@johnsoncherian johnsoncherian merged commit 5fdc42f into ToolJet:release/appbuilder-s20 Dec 19, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants