When updating a record that was accessed via a bookmark, Directus currently redirects the user back to the main collection view after saving. This disrupts the workflow, as the user must manually return to the bookmarked view they were working in.
Expected Behavior:
After saving, the user should remain within the bookmarked context or be redirected back to it automatically.
Directus Version: 11.8.0
This behavior is not currently implemented in Directus.
There’s an issue discussing it here: directus/directus#4025.
According to a team member, it was intentionally not implemented due to some underlying issues.
Since this was needed in a custom build, I experimented with a workaround by modifying the source.
For example:
function navigateToWithBookmark(path: string) {
router.push({
path,
query: route.query.bookmark ? { bookmark: route.query.bookmark } : undefined,
});
}
function navigateBack() {
const backState = router.options.history.state.back;
if (typeof backState !== 'string' || !backState.startsWith('/login')) {
router.back();
return;
}
navigateToWithBookmark(getCollectionRoute(props.collection));
}
If someone wants to modify this behavior, the relevant file is:
app/src/modules/content/routes/item.vue