-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[selection input] Don't reset selected index when dropdown results do…
…n't change (#28109) ## Summary & Motivation as titled. ## How I Tested These Changes https://github.com/user-attachments/assets/14cd6219-0d3f-4cdc-9adf-752218b320ec
- Loading branch information
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
js_modules/dagster-ui/packages/ui-core/src/hooks/usePrevious.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {useEffect, useRef} from 'react'; | ||
|
||
export const usePrevious = <T,>(value: T): T | undefined => { | ||
const ref = useRef<T>(); | ||
useEffect(() => { | ||
ref.current = value; | ||
}, [value]); | ||
return ref.current; | ||
}; |
This file contains 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
87716f9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for dagit-core-storybook ready!
✅ Preview
https://dagit-core-storybook-t39o16sq8-elementl.vercel.app
Built with commit 87716f9.
This pull request is being automatically deployed with vercel-action