mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-23 04:35:40 +00:00
Auto scroll to show this item when its tab becomes active
This commit is contained in:
@@ -85,6 +85,17 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText })
|
||||
useEffect(() => {
|
||||
dragPreview(getEmptyImage(), { captureDraggingState: true });
|
||||
}, []);
|
||||
|
||||
// Auto-scroll to show this item when its tab becomes active
|
||||
useEffect(() => {
|
||||
if (isTabForItemActive && ref.current) {
|
||||
try {
|
||||
ref.current.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
||||
} catch (err) {
|
||||
// ignore scroll errors (some environments may not support smooth scrolling)
|
||||
}
|
||||
}
|
||||
}, [isTabForItemActive])
|
||||
|
||||
const determineDropType = (monitor) => {
|
||||
const hoverBoundingRect = ref.current?.getBoundingClientRect();
|
||||
|
||||
Reference in New Issue
Block a user