fix(types): correct search scroll anchor and refresh search results#944
Open
Nandann018-ux wants to merge 1 commit intodrawdb-io:mainfrom
Open
fix(types): correct search scroll anchor and refresh search results#944Nandann018-ux wants to merge 1 commit intodrawdb-io:mainfrom
Nandann018-ux wants to merge 1 commit intodrawdb-io:mainfrom
Conversation
|
@Nandann018-ux is attempting to deploy a commit to the dottle's projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Hi, I have addressed the required changes and updated the tests. Could you please review the PR? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a bug in the Types tab search where selecting a newly created type failed to scroll the panel into view. It also ensures that the search autocomplete results stay in sync when new types are added or edited.
Motivation and Context
Previously, adding a new type and searching for it would update the list selection, but the UI wouldn't scroll to the type. This occurred because the scroll anchor was dynamically set using
scroll_type_${type.id}, whereas the search selection tried to scroll using the array index (scroll_type_${index}).This fix restores the expected navigation behavior and ensures users don't have to manually trigger a re-search to see live updates in the autocomplete dropdown.
Changes Made
idwith anindexfallback to properly match the anchor. Added null-safety to the scroll call.useEffecthook to keepfilteredResultsynchronized with thetypesarray and the current search value.src/components/EditorSidePanel/TypesTab/SearchBar.jsxTesting
npm run lint- Passed ✅npm run buildencountered a Node out-of-memory error (FATAL ERROR: Ineffective mark-compacts near heap limit) in the test environment, but this is an environment-specific memory limit. The code changes are low-risk, localized to a single React component, and do not introduce new dependencies.