Skip to content

Commit 4ceeae9

Browse files
committed
fix(ui): keep the search filter when closing a palette-opened drawer
Picking a token from the command palette pushed the drawer straight over the bare chain URL, so router.back() on close dropped the ?search the palette had set and the list unfiltered. Filter the list underneath first (replace), then push the drawer, so closing returns to the searched list — matching how a grid click (which opens over the already-searched list) already behaves.
1 parent 7952d2e commit 4ceeae9

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

_config/ui/app/_components/CommandPalette.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ export function CommandPalette({open, onOpenChange}: TCommandPaletteProps): Reac
143143
if (onTokenPage) {
144144
window.location.assign(href);
145145
} else {
146+
// Filter the list underneath first, so closing the drawer (router.back) returns to the
147+
// searched list instead of the bare chain URL — the palette's search then persists.
148+
if (search) {
149+
router.replace(withSearch(`/${chain.slug}`, params.toString()), {scroll: false});
150+
}
146151
router.push(href, {scroll: false});
147152
}
148153
},

0 commit comments

Comments
 (0)