feat(ItemsList): reset focus state when URL changes
This commit is contained in:
parent
109377f083
commit
afc70a56ba
1 changed files with 7 additions and 6 deletions
|
@ -274,13 +274,14 @@ export function ItemsList({ url }: ItemsListProps) {
|
|||
setPropertyLabels(prev => ({ ...prev, ...labels }));
|
||||
});
|
||||
}
|
||||
|
||||
// Set initial focus
|
||||
if (loadedItems.length > 0 && !focusedItemId) {
|
||||
setFocusedItemId(loadedItems[0].id);
|
||||
}
|
||||
}
|
||||
}, [itemsData, focusedItemId]);
|
||||
}, [itemsData]);
|
||||
|
||||
// Reset focus state when URL changes
|
||||
useEffect(() => {
|
||||
setFocusedCell(null);
|
||||
setFocusedItemId(null);
|
||||
}, [url]);
|
||||
|
||||
// Mutations
|
||||
const saveItemMutation = useMutation({
|
||||
|
|
Loading…
Add table
Reference in a new issue